Write the PHP-FPM timeout message on a single line - #2193
Merged
Merged
Conversation
Lambda turns each line written to stdout into a separate log event: the message was split into 3 events with the same timestamp, and only the first one started with the request ID. Searching the logs of a request missed the two explanatory lines, and log viewers could show them out of order. Also fix the link, the `#accessing-the-internet` anchor no longer exists. Claude-Session: https://claude.ai/code/session_01Awk33iZ9mDSg1xgSAPkgGK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a PHP-FPM request times out, Bref writes a message made of 3 lines. Lambda turns each line written to stdout into a separate log event, so it became 3 CloudWatch events with the same timestamp, and only the first one started with the request ID:
Searching the logs of a request (e.g.
filter @requestId = '…'in CloudWatch Logs Insights, see "Logs of a single request" in the logs documentation) returned only the first line, not the two explanatory ones, and since the 3 events share a timestamp, log viewers could show them out of order.This writes the same text on a single line. It also fixes the link: the
#accessing-the-internetanchor no longer exists, the section is now "VPC databases (private network)".Also the AWS SDK has a "recursion detection" step that adds an X-Amzn-Trace-Id header to AWS calls when _X_AMZN_TRACE_ID is set. In FPM that now happens, as it already did in the worker and console runtimes.