Commit f30186c0 authored by Marc Gravell's avatar Marc Gravell

make sure that _writeTickCount is set *before* it gets in the queue (otherwise...

make sure that _writeTickCount is set *before* it gets in the queue (otherwise heartbeat will freak)
parent b40a47e9
......@@ -626,13 +626,16 @@ internal void SetException(Exception exception)
internal void SetRequestSent()
{
Status = CommandStatus.Sent;
performance?.SetRequestSent();
}
// the time (ticks) at which this message was considered written
internal void SetWriteTime()
{
if ((Flags & NeedsAsyncTimeoutCheckFlag) != 0)
{
_writeTickCount = Environment.TickCount; // note this might be reset if we resend a message, cluster-moved etc; I'm OK with that
}
performance?.SetRequestSent();
}
// the time (ticks) at which this message was considered written
private int _writeTickCount;
private void SetNeedsTimeoutCheck() => Flags |= NeedsAsyncTimeoutCheckFlag;
......
......@@ -454,6 +454,7 @@ internal static void IdentifyFailureType(Exception exception, ref ConnectionFail
internal void EnqueueInsideWriteLock(Message next)
{
next.SetWriteTime();
lock (_writtenAwaitingResponse)
{
_writtenAwaitingResponse.Enqueue(next);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment