Skip to content

Commit

Permalink
TransferManager: log bugs with corresponding stack-trace
Browse files Browse the repository at this point in the history
Motivation:

There are a few places where TransferManager catches a RuntimeException
but logs this exception without any stack-trace.  A dCache admin might
not realise a log entry without a stack-trace is the result of a bug,
and so not report it.  Similarly, without a stack-trace, understanding
the bug becomes considerably harder.

Modification:

Update log entries to include a meaningful message and to log the
stack-trace.

Result:

TransferManager will now log bugs with the corresponding stack-trace,
making fixes any such bug easier.

Target: master
Requires-notes: yes
Requires-book: no
Request: 7.2
Request: 7.1
Request: 7.0
Request: 6.2
Patch: https://rb.dcache.org/r/13373/
Acked-by: Lea Morschel
  • Loading branch information
paulmillar authored and mksahakyan committed Feb 1, 2022
1 parent 255ba86 commit dea2844
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ private void sendErrorReply(int replyCode, Serializable errorObject) {
errorObject);
manager.sendMessage(new CellMessage(requestor, errorReply));
} catch (RuntimeException e) {
LOGGER.error(e.toString());
LOGGER.error("Send message failed:", e);
//can not do much more here!!!
}
//this will allow the handler to be garbage collected
Expand Down Expand Up @@ -695,7 +695,7 @@ private void sendErrorReply() {
errorObject);
manager.sendMessage(new CellMessage(requestor, errorReply));
} catch (RuntimeException e) {
LOGGER.error(e.toString());
LOGGER.error("Problem when sending failure report:", e);
//can not do much more here!!!
}
//this will allow the handler to be garbage collected
Expand Down Expand Up @@ -728,7 +728,7 @@ public void sendSuccessReply() {
TransferCompleteMessage errorReply = new TransferCompleteMessage(transferRequest);
manager.sendMessage(new CellMessage(requestor, errorReply));
} catch (RuntimeException e) {
LOGGER.error(e.toString());
LOGGER.error("Failed to send transfer complete message", e);
//can not do much more here!!!
}
//this will allow the handler to be garbage collected
Expand Down

0 comments on commit dea2844

Please sign in to comment.