Design behavior around timeouts and multiplexing
We don't currently handle timeouts with multiplexing. Think about this for both reading and writing.
Note that currently, if a non-multiplexed command is executed, it sets the sync timeout on the underlying socket (and will store it on the buffers for async timeout). If the connection is then returned to multiplexing mode (e.g. the transaction is completed), the timeout is unchanged, and therefore leaks from non-multiplexed to multiplexed operations.
One of the problems with #3809 seems to be this (specifically, one thread may change timeout via COPY operation). Maybe for now we should just always reset timeout to 0 for every command?
@roji ping
Coming back to this after a while.
Sure, makes sense at least as a temporary solution, especially if it's blocking #3809 (it would be really nice to get that in).
@roji with regards to this, we're using multiplexing and experiencing shorter-than-expected timeouts - is it just not implemented yet? e.g. some of our longer queries are timing out after 15s (the connection timeout) instead of the expected 30s (the command timeout)? The weird thing is the behaviour doesn't seem consistent, sometimes it times out after 30s and sometimes it goes back to 15s for the exact same query.
Multiplexing was removed in https://github.com/npgsql/npgsql/pull/6457