-
Notifications
You must be signed in to change notification settings - Fork 118
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
Warn about too low value for stream_select
's tv_usec
parameter
#1044
Comments
Uh, that's a very good catch @hollodotme. Will it be fine for you if I'll take this into Ultimate? |
Fine for me @kalessil. 😬 |
Also a question: did you hit the issue in production (perhaps a ticket on GitHub)? |
Yes, it was a long existing bug in hollodotme/fast-cgi-client, that popped up during this discussion and was fixed in the last release. It was quite hidden, because the |
Implemented! |
Current behaviour (description/screenshot:)
When using the
stream_select
function it is highly recommended by the official PHP documentation, that thetv_usec
parameter is set to at least200000
whentv_sec
is set to0
to keep CPU usage at a reasonable level.There is currently no inspection warning when using a lower
tv_usec
value.Expected behaviour
There should be a probable bug warning when the following conditions are met:
tv_sec
is set to0
tv_usec
is set to a value lower than200000
The warning message should contain a hint, that the given value may cause too high CPU usage.
The inspection should also apply if a static value in form of a constant is given to the function, like this:
Environment details
PhpStorm 2018.2.3 (but all versions)
The text was updated successfully, but these errors were encountered: