rpuch commented on code in PR #1246:
URL: https://github.com/apache/ignite-3/pull/1246#discussion_r1006835677
##########
modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java:
##########
@@ -626,6 +626,19 @@ public static void closeAll(AutoCloseable... closeables)
throws Exception {
closeAll(Arrays.stream(closeables));
}
+ /**
+ * Closes an {@link AutoCloseable} ignoring any exception it throws.
+ *
+ * @param closeable The AutoCloseable to close.
+ */
+ public static void closeQuietly(AutoCloseable closeable) {
+ try {
+ closeable.close();
+ } catch (Exception e) {
+ // Ignore.
Review Comment:
I close a cursor over TX data quietly when it is exhausted. There is no data
in it, we just sent all the data to the receiver, but the last batch. We are
closing and... an exception happens. How do we handle it?
It seemed to me that we should proceed quietly. Other options would be do
log the error and proceed, or just let the exception fly, probably killing the
50% (or 100%) finished snapshot.
WDYT about an optimal action here?
--
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]