You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2020/11/26 12:31:50 UTC
[GitHub] [cassandra] blerer commented on a change in pull request #835: Cassandra 16259 (trunk)
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org