mchro commented on a change in pull request #10339: [FLINK-14976][cassandra]
Release semaphore on all Throwable's in send()
URL: https://github.com/apache/flink/pull/10339#discussion_r351679763
##########
File path:
flink-connectors/flink-connector-cassandra/src/test/java/org/apache/flink/streaming/connectors/cassandra/CassandraSinkBaseTest.java
##########
@@ -296,6 +296,26 @@ public void testReleaseOnSendException() throws Exception
{
}
}
+ @Test(timeout = DEFAULT_TEST_TIMEOUT)
+ public void testReleaseOnSendError() throws Exception {
Review comment:
I tried a few approaches but was unable to really make it any less
duplicated: it all boils down to the fact that even though both `Error` and
`Exception` inherits from `Throwable` we are allowed to throw either `Error`
and `Exception` without adding to the throws clause --- but we are *not*
allowed to throw a `Throwable` without adding `Throwable` to the throws clause
of `send()`. Therefore using generics is not possible.
It is possible to use Function, but whether this is more nice or not I will
let you decide: I put it in a separate branch
https://github.com/apache/flink/compare/master...mchro:generify-cassandra-semaphore-leak-catch-throwable?expand=1
----------------------------------------------------------------
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