AMashenkov commented on code in PR #1980:
URL: https://github.com/apache/ignite-3/pull/1980#discussion_r1177507705
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java:
##########
@@ -467,15 +467,22 @@ private void sendFragment(
.schemaVersion(ctx.schemaVersion())
.build();
- var fut = new CompletableFuture<Void>();
- remoteFragmentInitCompletion.put(new
RemoteFragmentKey(targetNodeName, fragment.fragmentId()), fut);
+ CompletableFuture<Void>
remoteFragmentInitializationCompletionFuture = new CompletableFuture<>();
- try {
- messageService.send(targetNodeName, req);
- } catch (Exception ex) {
- fut.complete(null);
+ remoteFragmentInitCompletion.put(
+ new RemoteFragmentKey(targetNodeName,
fragment.fragmentId()),
+ remoteFragmentInitializationCompletionFuture
+ );
- throw ex;
+ try {
+ return messageService.send(targetNodeName, request);
+ } catch (Throwable th) {
+ // it's not expected MessageService to throw any exception,
yet it may be possible
+ // due to unpredictable side effects of different
implementations. To avoid blocking
+ // of node on stopping, let's complete initialization future.
+ remoteFragmentInitializationCompletionFuture.complete(null);
Review Comment:
Should we also remove future from remoteFragmentInitCompletion map if
exception is re-thrown.
--
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]