View | Details | Raw Unified | Return to bug 56724
Collapse All | Expand All

(-)java/org/apache/catalina/core/ContainerBase.java (-6 / +43 lines)
Lines 1335-1348 Link Here
1335
1335
1336
        @Override
1336
        @Override
1337
        public void run() {
1337
        public void run() {
1338
            while (!threadDone) {
1338
            Throwable t = null;
1339
                try {
1339
            String unexpectedDeathMessage = sm.getString(
1340
                    Thread.sleep(backgroundProcessorDelay * 1000L);
1340
                    "containerBase.backgroundProcess.unexpectedThreadDeath",
1341
                } catch (InterruptedException e) {
1341
                    Thread.currentThread().getName());
1342
                    // Ignore
1342
            try {
1343
                while (!threadDone) {
1344
                    try {
1345
                        Thread.sleep(backgroundProcessorDelay * 1000L);
1346
                    } catch (InterruptedException e) {
1347
                        // Ignore
1348
                    }
1349
                    if (!threadDone) {
1350
                        processChildren(ContainerBase.this);
1351
                    }
1343
                }
1352
                }
1353
            } catch (RuntimeException|Error e) {
1354
                t = e;
1355
                throw e;
1356
            } finally {
1357
                thread = null;
1344
                if (!threadDone) {
1358
                if (!threadDone) {
1345
                    processChildren(ContainerBase.this);
1359
                    log.error(unexpectedDeathMessage, t);
1360
                    if (t instanceof ThreadDeath
1361
                            || backgroundProcessorDelay <= 0
1362
                            || !getState().isAvailable()) {
1363
                        return;
1364
                    }
1365
                    try {
1366
                        Thread.sleep(backgroundProcessorDelay * 1000L);
1367
                    } catch (InterruptedException e) {
1368
                        // Ignore
1369
                    }
1370
                    if (threadDone || backgroundProcessorDelay <= 0
1371
                            || !getState().isAvailable()) {
1372
                        return;
1373
                    }
1374
                    try {
1375
                        log.info(sm.getString(
1376
                                "containerBase.backgroundProcess.restarting",
1377
                                ContainerBase.this), t);
1378
                        threadStart();
1379
                    } catch (RuntimeException | Error e) {
1380
                        log.error(unexpectedDeathMessage, e);
1381
                        throw e;
1382
                    }
1346
                }
1383
                }
1347
            }
1384
            }
1348
        }
1385
        }
(-)java/org/apache/catalina/core/LocalStrings.properties (+2 lines)
Lines 81-86 Link Here
81
containerBase.backgroundProcess.cluster=Exception processing cluster {0} background process
81
containerBase.backgroundProcess.cluster=Exception processing cluster {0} background process
82
containerBase.backgroundProcess.realm=Exception processing realm {0} background process
82
containerBase.backgroundProcess.realm=Exception processing realm {0} background process
83
containerBase.backgroundProcess.valve=Exception processing valve {0} background process
83
containerBase.backgroundProcess.valve=Exception processing valve {0} background process
84
containerBase.backgroundProcess.unexpectedThreadDeath=Unexpected death of background thread {0}
85
containerBase.backgroundProcess.restarting=Restarting background thread for {0}
84
defaultInstanceManager.invalidInjection=Invalid method resource injection annotation
86
defaultInstanceManager.invalidInjection=Invalid method resource injection annotation
85
filterChain.filter=Filter execution threw an exception
87
filterChain.filter=Filter execution threw an exception
86
filterChain.servlet=Servlet execution threw an exception
88
filterChain.servlet=Servlet execution threw an exception

Return to bug 56724