-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Log error cause when opcache cannot write to file cache #9258
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation LGTM (the test doesn't seem to work though)
f096cce
to
7baa0ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LCTM
posix_setrlimit(POSIX_RLIMIT_FSIZE, 1, 1) || die('skip Test requires setrlimit(RLIMIT_FSIZE) to work'); | ||
ini_parse_quantity(ini_get('opcache.jit_buffer_size')) === 0 || die('skip File cache is disabled when JIT is on'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I, personally, dislike this pattern (regardless of whether ||
or or
is used), and would go with a single line if
statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same. Although the style guide says you should add braces to if
statements. (Although granted that's for C)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I'd rather change the style guide, than to find some loopholes. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I don't find single line if
s to be an issue. IMO the only justified concern is:
#define FOO() foo(); bar()
if (baz) FOO();
Most of our macros guard against this with a do {} while(0);
loop though.
When using
opcache.file_cache
, opcache can log the following error when it fails to write a cache file:It is not always obvious why it failed. This PR adds the cause of the failure, for example: