Skip to content

Commit f72b775

Browse files
committed
Improve granularity of try/catch
Based on PR#968 by YCharanGowda.
1 parent 4dcb357 commit f72b775

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
@@ -363,16 +363,22 @@ protected void sendReplicationMessage(Request request, long totalstart, boolean
363363
start = System.currentTimeMillis();
364364
}
365365
try {
366+
// FIXME we have a lot of sends, but the trouble with one node stops the correct replication to other nodes!
366367
// send invalid sessions
367368
sendInvalidSessions(clusterManager);
368369
// send replication
369-
sendSessionReplicationMessage(request, clusterManager);
370-
if (isCrossContext) {
371-
sendCrossContextSession();
370+
try {
371+
sendSessionReplicationMessage(request, clusterManager);
372+
} catch (Exception e) {
373+
log.error(sm.getString("ReplicationValve.send.failure"), e);
374+
}
375+
try {
376+
if (isCrossContext) {
377+
sendCrossContextSession();
378+
}
379+
} catch (Exception e) {
380+
log.error(sm.getString("ReplicationValve.send.failure"), e);
372381
}
373-
} catch (Exception e) {
374-
// FIXME we have a lot of sends, but the trouble with one node stops the correct replication to other nodes!
375-
log.error(sm.getString("ReplicationValve.send.failure"), e);
376382
} finally {
377383
if (doStatistics()) {
378384
updateStats(totalstart, start, isAsync);

0 commit comments

Comments
 (0)