You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Etienne Chauchot (Jira)" <ji...@apache.org> on 2022/06/01 10:50:00 UTC

[jira] [Created] (FLINK-27866) CassandraOutputFormat and CassandraSink will timeout twice if the number of maximum requests is reached

Etienne Chauchot created FLINK-27866:
----------------------------------------

             Summary: CassandraOutputFormat and CassandraSink will timeout twice if the number of maximum requests is reached
                 Key: FLINK-27866
                 URL: https://issues.apache.org/jira/browse/FLINK-27866
             Project: Flink
          Issue Type: Improvement
          Components: Connectors / Cassandra
            Reporter: Etienne Chauchot


Both Sink and Outputformat have the same logic: they support _maxConcurrentRequests_ with a semaphore by counting the number of in-flight write requests and acquire/release semaphore permits with each new request begin/end. At close time, during the flush they wait for all the requests to be processed by acquiring all the permits set in the semaphore.

If a given write fails because there are still _maxConcurrentRequests_ in flight after the given wait period, a _TimeoutException_ will be thrown (while trying to acquire a permit from the semaphore) . Then Flink will catch this exception and close the sink/format. During the flush it will try to acquire permits from the semaphore once again and this will lead to another wait period and another {_}TimeoutException{_}. 

 

Ideally, we should wait only once and get only one TimeoutException.

 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)