Skip to content

Commit

Permalink
DcmSend: abort associations when I/O errors on cstore mid transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
Enet4 committed Dec 19, 2024
1 parent 8a64b37 commit 23897f8
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,27 @@ public void onDimseRSP(Association as, DicomObject cmd, DicomObject data) {
} catch (NoPresentationContextException e) {
LOGGER.warn("Cannot send {}: {}", info.item.getURI(), e.getMessage());
} catch (IOException e) {
LOGGER.error("Failed to send {}", info.item.getURI(), e);
LOGGER.error("Fatal I/O error while sending {}", info.item.getURI(), e);
// since this exception can be thrown mid-transfer,
// the sending process cannot be recovered.
// Abort the association and return.
try {
assoc.abort();
} catch (Exception ex) {
// ignore
LOGGER.warn("Association could not be aborted: {}", ex.getMessage());
}
return;
} catch (InterruptedException e) {
// should not happen
e.printStackTrace();
throw new RuntimeException(e);
}
}
try {
assoc.waitForDimseRSP();
} catch (InterruptedException e) {
// should not happen
e.printStackTrace();
throw new RuntimeException(e);
}
}

Expand Down

0 comments on commit 23897f8

Please # to comment.