[
https://issues.apache.org/jira/browse/HADOOP-19906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18091363#comment-18091363
]
ASF GitHub Bot commented on HADOOP-19906:
-----------------------------------------
pan3793 commented on code in PR #8522:
URL: https://github.com/apache/hadoop/pull/8522#discussion_r3471281461
##########
hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/SubjectUtil.java:
##########
@@ -335,9 +400,33 @@ public static <T> T doAs(
/**
* Maps to Subject.current() if available, otherwise maps to
Subject.getSubject().
*
+ * <p>On JDK 22+ also consults the Hadoop-managed
+ * {@link #CURRENT_SUBJECT_TL InheritableThreadLocal} so that platform
Threads which
+ * inherited a Subject from a parent's {@link #callAs} scope continue to
observe it.
+ * The JDK API {@code Subject.current()} (backed by {@code ScopedValue}) is
consulted
+ * first, so any future virtual-thread / {@code StructuredTaskScope} usage
that propagates
+ * the {@code ScopedValue} keeps working without falling back to the TLS
layer.
Review Comment:
Thread Local State, the name is proposed by LLM, I will change it to "Thread
Local" in docs.
> Alternative to SubjectInheritingThread to restore Subject propagation
> ---------------------------------------------------------------------
>
> Key: HADOOP-19906
> URL: https://issues.apache.org/jira/browse/HADOOP-19906
> Project: Hadoop Common
> Issue Type: Bug
> Components: security
> Affects Versions: 3.5.0, 3.4.3
> Reporter: Cheng Pan
> Priority: Major
> Labels: pull-request-available
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]