adutra commented on code in PR #1720:
URL:
https://github.com/apache/cassandra-java-driver/pull/1720#discussion_r1754222022
##########
test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm/CustomCcmRule.java:
##########
@@ -37,7 +40,20 @@ public class CustomCcmRule extends BaseCcmRule {
@Override
protected void before() {
if (CURRENT.get() == null && CURRENT.compareAndSet(null, this)) {
- super.before();
+ try {
+ super.before();
+ } catch (Exception e) {
+ // ExternalResource will not call after() when before() throws an
exception
+ // Let's try and clean up and release the lock we have in CURRENT
+ LOG.warn(
+ "Error in CustomCcmRule before() method, attempting to clean up
leftover state", e);
+ try {
+ after();
+ } catch (Exception e1) {
+ LOG.warn("Error cleaning up CustomCcmRule before() failure", e1);
Review Comment:
```suggestion
LOG.warn("Error cleaning up CustomCcmRule before() failure", e1);
e.addSuppressed(e1);
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]