diff options
| author | Andrew MacBean <macbean@apache.org> | 2014-06-19 09:42:45 +0000 |
|---|---|---|
| committer | Andrew MacBean <macbean@apache.org> | 2014-06-19 09:42:45 +0000 |
| commit | 5ee6c9aec2fe07ed61fae0436b1956c454dd9f25 (patch) | |
| tree | 719db11548772ff2d38246b26cdbdd63f6f28f83 /qpid/java | |
| parent | 45dc5a66eb08870de0c6cd20f68b5b465057fe09 (diff) | |
| download | qpid-python-5ee6c9aec2fe07ed61fae0436b1956c454dd9f25.tar.gz | |
QPID-5831: Unexpected internal exception when closing JE Replicated environment
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1603791 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
| -rw-r--r-- | qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java index f8c08dec04..b0cac5fad9 100644 --- a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java +++ b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java @@ -782,8 +782,28 @@ public class ReplicatedEnvironmentFacade implements EnvironmentFacade, StateChan } finally { - _environment.close(); - _environment = null; + // Try closing the environment but swallow EnvironmentFailureException + // if the environment becomes invalid while closing. + // This can be caused by potential race between facade close and DatabasePinger open. + try + { + _environment.close(); + } + catch (EnvironmentFailureException efe) + { + if (!_environment.isValid()) + { + LOGGER.debug("Environment became invalid on close, so ignore", efe); + } + else + { + throw efe; + } + } + finally + { + _environment = null; + } } } |
