Skip to content

add flushed_http_code tag - #1678

Open
Shamzik wants to merge 7 commits into
masterfrom
kshamazov/flushed_http_code
Open

add flushed_http_code tag#1678
Shamzik wants to merge 7 commits into
masterfrom
kshamazov/flushed_http_code

Conversation

@Shamzik

@Shamzik Shamzik commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

This PR adds flushed_http_code tag to http metrics

@Shamzik Shamzik self-assigned this Aug 20, 2026
@Shamzik Shamzik added runtime Feature related to runtime kphp Affects compiler or runtime in default mode (not K2) labels Aug 20, 2026
@Shamzik Shamzik added this to the next milestone Aug 20, 2026
@Shamzik
Shamzik force-pushed the kshamazov/flushed_http_code branch from 6a2c5b8 to ffbb687 Compare August 26, 2026 11:49
@Shamzik
Shamzik force-pushed the kshamazov/flushed_http_code branch from ffbb687 to de1e7c3 Compare August 26, 2026 12:36
KPHP-CI
KPHP-CI previously approved these changes Aug 27, 2026

@KPHP-CI KPHP-CI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Brilliant work!

Comment thread server/php-worker.h
php_query_data_t data;

bool paused;
bool flushed_http_connection;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We already have a global containing the HTTP code. Can we use it instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

if (process_type == ProcessType::http_worker) {
client.metric("kphp_by_host_http_connection_process_time", true).tag(status).write_value(http_connection_process_time);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's try finding a way to not use this hack

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

see last commit

@apolyakov apolyakov modified the milestones: 03.09.26, next Sep 3, 2026
GCC 8 inlines copies of pack_string into callers and merges them
(cross-jumping), after which it loses the relation between `len` and
the source object and emits false positive -Warray-bounds for small
string literals. Mark pack_string noinline for GCC 8 only.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kphp Affects compiler or runtime in default mode (not K2) runtime Feature related to runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants