blerer commented on a change in pull request #835:
URL: https://github.com/apache/cassandra/pull/835#discussion_r530997483
##########
File path: src/java/org/apache/cassandra/db/transform/BaseIterator.java
##########
@@ -83,14 +87,31 @@
public final void close()
{
+ // If close has already been called we want to ignore other calls
+ if (closed)
Review comment:
If the iterator has been registered in multiples `try-with-resources`
(the root of the problem we are trying to solve) and a bad implementation of
`runOnClose` fire an Exception, the next `try-with-resources` will hit the same
problem and will hide the original one. No matter how the execution of `close`
end up, I do not think that there are any scenarios in which you want to retry
closing the iterator. Which is why the patch toggle `closed` as early as
possible.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]