diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/util/ThreadLocalRequestScopePropagator.java b/gerrit-server/src/main/java/com/google/gerrit/server/util/ThreadLocalRequestScopePropagator.java index 403701a44b..581ccc1483 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/util/ThreadLocalRequestScopePropagator.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/util/ThreadLocalRequestScopePropagator.java @@ -74,6 +74,13 @@ public abstract class ThreadLocalRequestScopePropagator /** * Returns a new context object based on the passed in context that has no * request scoped objects initialized. + *

+ * Note that some code paths expect request-scoped objects like + * {@code CurrentUser} to be constructible starting from just the context + * object returned by this method. For example, in the SSH scope, the context + * includes the {@code SshSession}, which is used by + * {@code SshCurrentUserProvider} to construct a new {@code CurrentUser} in + * the new thread. * * @param ctx the context to continue. * @return a new context.