Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SPY-192: Ensure connection key is valid before checking if writable.
Motivation ---------- It has been discovered in the wild that sometimes CancelledKeyException are received even if the key has been checked for validity before. It turns out that the validity can change between the check and the next function call. Modifications ------------- The changeset makes sure to check if it is valid on both reading and subsequent writing, reducing the chance of race conditions and interleaved state changes. Result ------ More stable behavior at runtime and less chance of CancelledKeyException. Change-Id: Ic0db65f9c7ccc3a7b9738aaff0e3c7e60d7f25c2 Reviewed-on: http://review.couchbase.org/72270 Reviewed-by: Michael Nitschinger <michael@nitschinger.at> Tested-by: Michael Nitschinger <michael@nitschinger.at>
- Loading branch information