mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 06:09:55 +01:00
Continue shutdown if an exception is thrown.
This commit is contained in:
@@ -198,11 +198,15 @@ class LifecycleManagerImpl implements LifecycleManager, MigrationListener {
|
|||||||
state = STOPPING;
|
state = STOPPING;
|
||||||
eventBus.broadcast(new LifecycleEvent(STOPPING));
|
eventBus.broadcast(new LifecycleEvent(STOPPING));
|
||||||
for (Service s : services) {
|
for (Service s : services) {
|
||||||
long start = now();
|
try {
|
||||||
s.stopService();
|
long start = now();
|
||||||
if (LOG.isLoggable(FINE)) {
|
s.stopService();
|
||||||
logDuration(LOG, "Stopping service "
|
if (LOG.isLoggable(FINE)) {
|
||||||
+ s.getClass().getSimpleName(), start);
|
logDuration(LOG, "Stopping service "
|
||||||
|
+ s.getClass().getSimpleName(), start);
|
||||||
|
}
|
||||||
|
} catch (ServiceException e) {
|
||||||
|
logException(LOG, WARNING, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (ExecutorService e : executors) {
|
for (ExecutorService e : executors) {
|
||||||
@@ -212,12 +216,14 @@ class LifecycleManagerImpl implements LifecycleManager, MigrationListener {
|
|||||||
}
|
}
|
||||||
e.shutdownNow();
|
e.shutdownNow();
|
||||||
}
|
}
|
||||||
long start = now();
|
try {
|
||||||
db.close();
|
long start = now();
|
||||||
logDuration(LOG, "Closing database", start);
|
db.close();
|
||||||
|
logDuration(LOG, "Closing database", start);
|
||||||
|
} catch (DbException e) {
|
||||||
|
logException(LOG, WARNING, e);
|
||||||
|
}
|
||||||
shutdownLatch.countDown();
|
shutdownLatch.countDown();
|
||||||
} catch (DbException | ServiceException e) {
|
|
||||||
logException(LOG, WARNING, e);
|
|
||||||
} finally {
|
} finally {
|
||||||
startStopSemaphore.release();
|
startStopSemaphore.release();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user