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
{{ message }}
Repository navigation
Commit f591784
Browse filesBrowse the repository at this point in the historyBrowse files
[TEST] Watch the retry from outside the client, not from inside its queue
The two retry cases waited by polling the retry queue through a test peer. That
queue has no lock, because only the background thread is supposed to touch it,
and a peer reading it from the test thread makes that untrue. ThreadSanitizer
says so: two data races, both this read against the background thread's
push_back, and both of them mine rather than the client's.
So the wait moved outside. It waits on what the server received, which is
behind a mutex and a condition variable, and then for long enough that the
answer has been read and the session put back with its wait on it. The wait is
eight seconds and the settling is one, so a request still outstanding at that
point is outstanding because it is queued, and there are seven seconds left for
the case to be wrong in.
The first attempt at this waited for the server to see a second request, on the
grounds that a retry having fired proves the queue works. It does, but it
proves it one step too late: at that moment the client is reading the second
answer rather than holding a queued session, so cancelling caught a transfer in
flight and the mutation check went green. Both cases now fail against a queue
check that only drops entries with no operation, three runs out of three, at
5.40 seconds against a bound of four, and pass in about a second.
ThreadSanitizer reports nothing on the whole binary now, and all 40 cases pass.
Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
0 commit comments