mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 08:52:06 +00:00
Fix error on OS X regarding resetting timeouts.
This happens when remote disconnects due to inactivity. It seems to work on Linux, likely due to difference in SO_LINGER, maybe a different default timeout on Darwin. Verified manually using clickhouse cloud using following process: 1. Connect to instance. 2. Run `show tables`. 3. Wait 6 minutes. 4. Run `show tables`. With this fix, the EINVAL is not reported, and client will simply reconnect.
This commit is contained in:
parent
dfbba48510
commit
c87b33a24d
@ -31,13 +31,15 @@ TimeoutSetter::~TimeoutSetter()
|
||||
{
|
||||
try
|
||||
{
|
||||
bool connected = socket.impl()->initialized();
|
||||
if (!connected)
|
||||
return;
|
||||
|
||||
socket.setSendTimeout(old_send_timeout);
|
||||
socket.setReceiveTimeout(old_receive_timeout);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
/// Sometimes caught on Mac OS X. This message can be safely ignored.
|
||||
/// If you are developer using Mac, please debug this error message by yourself.
|
||||
tryLogCurrentException("Client", "TimeoutSetter: Can't reset timeouts");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user