Skip to content

Commit b628a63

Browse files
committed
Improve granularity of try/catch
Based on PR#968 by YCharanGowda.
1 parent 0ebddbe commit b628a63

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

java/org/apache/catalina/ha/tcp/ReplicationValve.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,16 +362,22 @@ protected void sendReplicationMessage(Request request, long totalstart, boolean
362362
start = System.currentTimeMillis();
363363
}
364364
try {
365+
// FIXME we have a lot of sends, but the trouble with one node stops the correct replication to other nodes!
365366
// send invalid sessions
366367
sendInvalidSessions(clusterManager);
367368
// send replication
368-
sendSessionReplicationMessage(request, clusterManager);
369-
if (isCrossContext) {
370-
sendCrossContextSession();
369+
try {
370+
sendSessionReplicationMessage(request, clusterManager);
371+
} catch (Exception e) {
372+
log.error(sm.getString("ReplicationValve.send.failure"), e);
373+
}
374+
try {
375+
if (isCrossContext) {
376+
sendCrossContextSession();
377+
}
378+
} catch (Exception e) {
379+
log.error(sm.getString("ReplicationValve.send.failure"), e);
371380
}
372-
} catch (Exception e) {
373-
// FIXME we have a lot of sends, but the trouble with one node stops the correct replication to other nodes!
374-
log.error(sm.getString("ReplicationValve.send.failure"), e);
375381
} finally {
376382
if (doStatistics()) {
377383
updateStats(totalstart, start, isAsync);

0 commit comments

Comments
 (0)