[
https://issues.apache.org/jira/browse/GEODE-3692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16545507#comment-16545507
]
Patrick Rhomberg commented on GEODE-3692:
-----------------------------------------
During some initial investigation, it appears the core issue may be that we use
{{ ThreadContext.remove();}} in the {{IntegratedSecurityService}} class.
This method fully-clears the ThreadContext, including the binding of our
{{SecurityManager}}. When a thread is later re-used, it may be this that is
causing our NPE.
Suggested amelioration: refactor various uses of {{ThreadContext}} to use
{{SubjectThreadState}} instead, particularly replacing {{ThreadContext.remove}}
with {{SubjectThreadState.restore}}.
> Intermittent test failure: ClientAuthDUnitTest
> ----------------------------------------------
>
> Key: GEODE-3692
> URL: https://issues.apache.org/jira/browse/GEODE-3692
> Project: Geode
> Issue Type: Bug
> Components: security
> Affects Versions: 1.2.1
> Reporter: Kenneth Howe
> Priority: Major
> Labels: Ci
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> This {{authWithCorrectPasswordShouldPass}} fails intermittently in Geode
> nightly builds.
> {code}
> [vm1] [info 2017/09/19 21:27:57.967 UTC <poolTimer-DEFAULT-2> tid=0x1bc]
> Error prefilling connections :
> org.apache.geode.security.AuthenticationFailedException: No SecurityManager
> accessible to the calling code, either bound to the
> org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an
> invalid application configuration.
> [vm1] org.apache.geode.security.AuthenticationFailedException: No
> SecurityManager accessible to the calling code, either bound to the
> org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an
> invalid application configuration.
> [vm1] at
> org.apache.geode.internal.cache.tier.sockets.HandShake.verifyCredentials(HandShake.java:1696)
> [vm1] at
> org.apache.geode.internal.cache.tier.sockets.ServerConnection.setCredentials(ServerConnection.java:1029)
> [vm1] at
> org.apache.geode.internal.cache.tier.sockets.command.PutUserCredentials.cmdExecute(PutUserCredentials.java:52)
> [vm1] at
> org.apache.geode.internal.cache.tier.sockets.BaseCommand.execute(BaseCommand.java:162)
> [vm1] at
> org.apache.geode.internal.cache.tier.sockets.ServerConnection.doNormalMsg(ServerConnection.java:785)
> [vm1] at
> org.apache.geode.internal.cache.tier.sockets.LegacyServerConnection.doOneMessage(LegacyServerConnection.java:85)
> [vm1] at
> org.apache.geode.internal.cache.tier.sockets.ServerConnection.run(ServerConnection.java:1166)
> [vm1] at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> [vm1] at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> [vm1] at
> org.apache.geode.internal.cache.tier.sockets.AcceptorImpl$1$1.run(AcceptorImpl.java:557)
> [vm1] at java.lang.Thread.run(Thread.java:748)
> [vm1] Caused by: org.apache.shiro.UnavailableSecurityManagerException: No
> SecurityManager accessible to the calling code, either bound to the
> org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an
> invalid application configuration.
> [vm1] at
> org.apache.shiro.SecurityUtils.getSecurityManager(SecurityUtils.java:123)
> [vm1] at
> org.apache.shiro.subject.Subject$Builder.<init>(Subject.java:627)
> [vm1] at
> org.apache.shiro.SecurityUtils.getSubject(SecurityUtils.java:56)
> [vm1] at
> org.apache.geode.internal.security.IntegratedSecurityService.login(IntegratedSecurityService.java:133)
> [vm1] at
> org.apache.geode.internal.cache.tier.sockets.HandShake.verifyCredentials(HandShake.java:1686)
> [vm1] ... 10 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)