Reduce slow DCB shutdown timeout to 2 seconds
This helps reduce the effect that a hanging connection has on the whole system. Making this configurable shouldn't be needed as long as the rate of authentication failures doesn't exceed an acceptable level. In most practical cases allowing two seconds for authentication to complete should be enough.
This commit is contained in:
parent
c5b47389df
commit
df87df3a0d
@ -165,9 +165,10 @@ void modules_thread_finish()
|
||||
|
||||
bool can_close_dcb(DCB* dcb)
|
||||
{
|
||||
const int SHOW_SHUTDOWN_TIMEOUT = 2;
|
||||
auto idle = MXS_CLOCK_TO_SEC(mxs_clock() - dcb->last_read);
|
||||
|
||||
return idle > 5 // Timed out
|
||||
return idle > SHOW_SHUTDOWN_TIMEOUT // Timed out
|
||||
|| !dcb->func.can_close // Not implemented
|
||||
|| dcb->func.can_close(dcb); // Protocol says it's OK to close
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user