If the request completes with error after the response has already been received we can potentially resume a continuation twice. This was shown by running some of the tests in long loop.
Modifications
Add a shorter test that more reliably reproduced the issue.
Add the fix: to set the continuation to nil after resuming it, while still holding the lock.
Result
Removed a source of a potential runtime crash.
Test Plan
The newly added test, which reliably failed, now reliably passes.
Motivation
If the request completes with error after the response has already been received we can potentially resume a continuation twice. This was shown by running some of the tests in long loop.
Modifications
nil
after resuming it, while still holding the lock.Result
Test Plan