Skip to content

Fix bug #77653 (operator displayed instead of the real error message) #5161

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

Closed
wants to merge 1 commit into from

Conversation

bukka
Copy link
Member

@bukka bukka commented Feb 9, 2020

Fix for https://bugs.php.net/bug.php?id=77653 . It's #4007 rebased on 7.4.

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been a while since I last looked at this, so I've forgotten some of the context for this change...

I don't quite get why we need \0fscf as the flush command, wouldn't using \n work as well? It seems like the handling for both is basically the same (zlog_stream_str + zlog_stream_finish), just simpler for \n because it's a single character.

@bukka
Copy link
Member Author

bukka commented Feb 16, 2020

I don't quite get why we need \0fscf as the flush command, wouldn't using \n work as well? It seems like the handling for both is basically the same (zlog_stream_str + zlog_stream_finish), just simpler for \n because it's a single character.

@nikic It's because \n would add an extra new line to the logs. Basically \0fscf is noop if there isn't anything in the buffer but \n would add an extra new line which wouldn't be probably nice as it happens after each request...

@cmb69 cmb69 added the Bug label Feb 18, 2020
@bukka
Copy link
Member Author

bukka commented Feb 23, 2020

Merged as ee05793

@bukka bukka closed this Feb 23, 2020
@nikic
Copy link
Member

nikic commented Feb 24, 2020

I think after this change we are seeing intermittent failures like this:

========DIFF========
001+ ERROR: Unexpected line: [24-Feb-2020 11:10:01] NOTICE: Terminating ...
002+
========DONE========
FAIL FPM: Buffered worker output decorated log with msg containing new lines [sapi/fpm/tests/log-bwd-msg-with-nl.phpt] 

@nikic
Copy link
Member

nikic commented Feb 26, 2020

I think that's because there is a race condition now: Previously (I think) we first flushed stdio and then closed the body stream. Now we do it the other way around. This means that we may have either:

  1. tester receives full response body
  2. worker flushes stdio
  3. tester issues terminate

or

  1. tester received full response body
  2. tester issues terminate
  3. worker flushes stdio

Because of this, we may see log messages in both orders.

Do you know what we can do against this? It's causing a lot of CI failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants