mchro commented on a change in pull request #8967: [FLINK-13059][Cassandra
Connector] Release Semaphore correctly on Exception in send()
URL: https://github.com/apache/flink/pull/8967#discussion_r303794850
##########
File path:
flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSinkBase.java
##########
@@ -158,8 +164,17 @@ private void checkAsyncErrors() throws Exception {
}
}
- private void flush() {
-
semaphore.acquireUninterruptibly(config.getMaxConcurrentRequests());
+ private void flush() throws InterruptedException, TimeoutException {
+ if (!semaphore.tryAcquire(config.getMaxConcurrentRequests(),
config.getMaxConcurrentRequestsTimeout().toMillis(), TimeUnit.MILLISECONDS)) {
Review comment:
Yes, good idea. I will push an additional commit with this refactor.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services