-
Notifications
You must be signed in to change notification settings - Fork 36
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
move requires from register to top for eager loading, cleanups #10
move requires from register to top for eager loading, cleanups #10
Conversation
LGTM |
👍 @ph thanks |
will bump version and publish |
LGTM Some history on deferred
Both of the above historical issues are no longer problems, so in general, I am in favor of moving requires to the top of files in most cases :) |
@jordansissel thanks for the context. we did have this discussion previously "somewhere" :P and agreed to move back requires at the top. The bad news is that I just found out that this does not solve the problem here. I am still getting the same problem in my stress tests. investigating. |
@colinsurprenant bummer that your change didn't solve the problem, but at least it improved style :P |
@ph @jordansissel with this last commit, moving the digest class selection in register seems to fix the problem. I haven't been able to reproduce it after 500 runs. I will run another 1000 runs before going to bed, in the meantime if you can re-review this so I can push it to @cdahlqvist so he can also test it in his environment. |
The night stress run did not show any exception so I will call this issue "solved" without fully understanding the original cause. It hurts my OCD to walk away from trying to find the exact root cause but the intermittent nature makes it really hard to track. I have also tried to reproduce using the same openssl initialization + call logic with threads but outside the context of logstash without success. The good news is this problem always surfaced upon the processing of the first event and does not happen anytime during the logstash runtime. I believe this is a concurrency/threading + constant visibility issue, by placing a rescue block around the code that produced the NameError exception, and doing a sleep(0.5) && retry, it worked. In that context, it makes sense that this refactor solves the issue. |
I am OK with that, I think we should keep that problem in mind when working with plugins. Like you I am not sure what make OpenSSL is so special. |
LGTM |
@ph thanks. I really don't know, and AFAICT OpenSSL does not do anything special, no autoload etc. The only thing "different" is that the |
version 2.0.3 pushed |
register
methodfixes elastic/logstash/issues/4419
[edited to add 2nd commit changes]