Skip to content

make sure that server does not send body on HTTP HEAD#80860

Merged
CheSema merged 3 commits intomasterfrom
chesema-fix-http-head
May 30, 2025
Merged

make sure that server does not send body on HTTP HEAD#80860
CheSema merged 3 commits intomasterfrom
chesema-fix-http-head

Conversation

@CheSema
Copy link
Copy Markdown
Member

@CheSema CheSema commented May 26, 2025

Fixes #80725

Servet should never send message body on HTTP HEAD request. Otherwise the connection is poisoned because client does not read a body, in case if keep alive, the next request fails in surprising way.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

fix and make sure that clickhouse server does not send body on HTTP HEAD request

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented May 26, 2025

Workflow [PR], commit [2aee21e]

@clickhouse-gh clickhouse-gh bot added the pr-ci label May 26, 2025
@CheSema CheSema force-pushed the chesema-fix-http-head branch from 7747c00 to c448aa1 Compare May 26, 2025 19:05
@CheSema CheSema marked this pull request as ready for review May 27, 2025 11:13
@Michicosun Michicosun self-assigned this May 27, 2025
auto str = header.str();
header_stream = std::make_shared<AutoFinalizedWriteBuffer<WriteBufferFromPocoSocket>>(session.socket(), write_event, str.size());
header_stream->write(str);
header_stream->write(str.data(), str.size());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why?

Copy link
Copy Markdown
Member Author

@CheSema CheSema May 30, 2025

Choose a reason for hiding this comment

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

Because only WriteBufferFromPocoSocket has
void write(const std::string & str) method.

Ordinary WriteBuffer has only
void write(const char * from, size_t n)

@CheSema CheSema force-pushed the chesema-fix-http-head branch from 306413e to 2aee21e Compare May 30, 2025 16:06
@CheSema CheSema added this pull request to the merge queue May 30, 2025
Merged via the queue into master with commit ec32fd4 May 30, 2025
120 checks passed
@CheSema CheSema deleted the chesema-fix-http-head branch May 30, 2025 20:17
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 30, 2025
@CheSema CheSema restored the chesema-fix-http-head branch June 10, 2025 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

03519_storage_url is flaky | HTTP HEAD is broken

3 participants