-
Notifications
You must be signed in to change notification settings - Fork 1.6k
SpnegoEngine thread safety #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Salut, do me a pull request with your change and I will integrate them. This is easier to track and less error prone. Thanks! |
This is my first pull request, so it is error prone, but I think #95 seems ok. |
@jfarcand this one can be closed as the PR was merged. |
Any chance of this fix getting into the 1.8 branch? |
Backported, will be in next release. |
Excellent! Many thanks.
|
Hello,
Using gatling to load test a CAS with Spnego, I start to have NullPointerException at 20 concurrent users (all using my credentials).
The exception is :
java.io.IOException
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.construct
(NettyAsyncHttpProvider.java:658)
Caused by: java.lang.NullPointerException
at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:2
36)
at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:1
62)
at com.ning.http.client.providers.netty.spnego.SpnegoEngine.generateToke
n(SpnegoEngine.java:343)
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.construct
(NettyAsyncHttpProvider.java:656)
... 18 more
I identified two attributes in SpnegoEngine that make it non thread safe (gatling use only one NettyAsyncHttpProvider) :
private GSSContext gssContext = null;
private byte[] token;
They can be defined as local variables in generateToken method : NPE disappears, and it solves the load problem with gatling.
Could you integrate this modification ?
As I can now load test our CAS Spnego server, this makes my issue (https://github.com/sonatype/async-http-client/issues/83) less important (I dont succeed by the way).
Thanks for gatling users,
Fabien.
The text was updated successfully, but these errors were encountered: