-
Notifications
You must be signed in to change notification settings - Fork 562
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
Spark: Cold start occassionally throws NullPointer exception #71
Comments
Thanks @lskrajny - marking as a bug for now. I'll investigate and let you know next week. |
I could replicate this in travis CI but not in local. I suspect this is a race condition where the This seems to work in the travis CI build, the only place where I could replicate the issue - still not clear whether this is an issue with Spark 2.6.0 or something that is expected. @lskrajny can you help me test by checking out |
tested it but unfortunately this doesn't still seem to work:
|
Thanks for testing @lskrajny - I'll try and do some more work to replicate it. I would expect it to happen with the unit tests that start applications but so far I haven't had any luck. |
Hey @lskrajny - I'm still struggling to replicate in local. However, Travis CI did fail the build with a similar issues, really seems to be a race condition. I have made a couple of small changes and since then the Travis build has worked correctly. Do you mind testing again version |
Hi @sapessi - tested recent build, and observed NPE now is indeed less frequent, but it still exists. So possibility of the race was reduced but not eliminated. In the meantime found solution to the initial problem, after adding So initialization code looks like this (based on PetStore example):
So the solution is either to modify the spark example to block until spark is initialized or trying to incorporate the fix in the library. Hope that helps |
Thanks @lskrajny - I was basing my implementation on the default Jetty embedded server and it doesn't look like they call that method. Regardless, sounds like the right thing to do. I will incorporate the call in the framework and commit the changes now. Thanks for putting so much time into this. I'll push out 0.8 ASAP |
Cool, once done will test |
Change is committed to the servlet-improvements branch. All unit tests still pass. |
Strange, it is still throwing NPE :/ Could it be it is executing Regression tested using |
Looks like you are right. may have to call the awaitInitialization() after the routes are included. I'll add it to the documentation and sample instead :( |
…ds to be called after the resources are defined
ok. Pushed the updates to the |
@lskrajny I'm closing this issue for now. If you run into the error again even with the awaitInitialization re-open it and I'll dig deeper. |
Following spark sample, occasionally getting:
The text was updated successfully, but these errors were encountered: