You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a feature where we allow a different timeout to be defined for "internal commands" (InternalCommandTimeout instead of UserTimeout). This is meant to also apply to prepended commands (which are always "internal"), but it seems to be broken: if there are prepended responses, we set ReceiveTimeout to InternalcommandTimeout, but then recursively call ReadMessageLong which will overwrite it with UserTimeout.
One problem I have with InternalCommandTimeout is that like the regular CommandTimeout, it's pretty coarse; we could make it affect committing, but it would also affect rolling back, and various other internal stuff. So having a single "internal" value doesn't seem to be considerably more helpful than just using the general timeout on the connection.
Specifically for transactions, we could add a timeout property to the transaction, and that value would be used when committing and rolling back; this would be similar to how you can set a per-command timeout.
We should review the original motivation for having this separate timeout, and consider removing it. If we don't remove it, we should fix the implementation here, for both sync and async.
So what is the fix - the UserTimeout is used also for internal commands now?
Yep. Right now we only have 2 internal commands: one is for BEGIN TRANSACTION and another is for connection reset. Both of them should be extremely quick, so in general users don't really need to change their timeout anyway. And since it never worked in the first place and removing it does simplify code quite a bit, well...
Activity
Obsolete InternalCommandTimeout (#4856)
NinoFloris commentedon Jun 27, 2024
Completed in #4856
emz00 commentedon Jun 28, 2024
So what is the fix - the UserTimeout is used also for internal commands now?
vonzshik commentedon Jun 28, 2024
Yep. Right now we only have 2 internal commands: one is for
BEGIN TRANSACTIONand another is for connection reset. Both of them should be extremely quick, so in general users don't really need to change their timeout anyway. And since it never worked in the first place and removing it does simplify code quite a bit, well...