Please sign in to comment.
Fixed handling of unsubscribe race condition.
It was possible to cancel a subscription via timeout or cancellator while in the process of receiving a message. This would cause the unsubscribe to fail, and would leave unparsed junk in the buffer. This could also cause the message to be dropped, which is bad. The solution is to detect when the unsubscribe fails and parse the new-found message like nothing happened. Unfortuntely, the CancelOk response from the unsubscribe is still somewhere in our buffer and needs to be processed or else it will break things. The logic is more complicated as a result, but should be able to handle all possible states of the buffer.
- Loading branch information...
Showing with 67 additions and 16 deletions.