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:
ThreadLocal State, the name is proposed by LLM, I will change it to
"ThreadLocal" in docs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]