JAVA-3055 CqlPrepareAsyncProcessor must handle cancellations of the r…
Hi @tomas-bilka thank you for the PR.
Have you signed the Contributor License Agreement for contributions to DataStax open source projects? If not you can find it at https://cla.datastax.com/. Thanks!
I just signed the CLA.
I made another PR for 3055 some time ago. Then had a review from a colleague for a better and simpler implementation which I believe is quite nice.
See https://github.com/apache/cassandra-java-driver/pull/1757
Any progress?
I think this approach doesn't seem to be able to prevent the underlying problem.
There is edge case When two duplicate prepare requests A and B are received (assuming A arrived slightly earlier), the cancellation of one request propagates to the other.
- Request A
- Cache loaded with request A. Asynchronous prepare call to Cassandra (referred to as 'a')
- Request B
- B waits for a response from the cache based on request A
- cancel() in request A
- B receives the cancel() from request A and propagates a CancellationException
- Response from 'a' completes. Upon receiving the cancellation of A, cache invalidation proceeds at this time
In my opinion, lucboutier's PR looks better to me.