Skip to content

Fix exception 'No message received'#4856

Merged
alexey-milovidov merged 1 commit intomasterfrom
fix_no_message_received_keepalive
Mar 29, 2019
Merged

Fix exception 'No message received'#4856
alexey-milovidov merged 1 commit intomasterfrom
fix_no_message_received_keepalive

Conversation

@alesapin
Copy link
Copy Markdown
Member

@alesapin alesapin commented Mar 29, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

For changelog. Remove if this is non-significant change.

Category (leave one):

  • Bug Fix

Short description (up to few sentences):
Fix No message received exception in replication.

Detailed description:
Default server keep_alive_timeout is 3 seconds https://github.com/yandex/ClickHouse/blob/master/dbms/programs/server/config.xml#L88. But default Poco HTTPClientSession timeout is 8 seconds https://github.com/ClickHouse-Extras/poco/blob/d0271f990869b7f23dac4bb2ee0c127cf815f077/Net/include/Poco/Net/HTTPClientSession.h#L269. Server closes connection in three seconds, but client session tries to reconnect after 8 seconds https://github.com/ClickHouse-Extras/poco/blob/d0271f990869b7f23dac4bb2ee0c127cf815f077/Net/src/HTTPClientSession.cpp#L403. If we make request in interval between (3, 8] seconds after previous we will try to write in CLOSE_WAIT socket and exception No message received will be thrown.

Closes: #4047

@nvartolomei
Copy link
Copy Markdown
Contributor

Nice debug :) there is still a very small chance that connection will be in close wait if this check succeeds, time drift/vm pauses. Negligible to some degree :)

@alexey-milovidov alexey-milovidov merged commit 5588618 into master Mar 29, 2019
@abyss7 abyss7 added the pr-bugfix Pull request with bugfix, not backported by default label Apr 10, 2019
@fosterbt
Copy link
Copy Markdown

Hi. I'm wondering if you may have considered this actually to be a bug in Poco? The Poco docs say nothing about only being able to send data over an HTTPClientSession object when the underlying socket is in a given state. In fact, I'd think this Poco class should be able to handle this situation, especially when using HTTP/1.1 keepalive persistent connections. I say this because I've seen the same problem in a project I'm working on that uses Poco.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Poco::Exception. Code: 1000, e.code() = 0

5 participants