diff --git a/server/src/main/java/com/metamx/druid/coordination/ServerManager.java b/server/src/main/java/com/metamx/druid/coordination/ServerManager.java index 5e7fc9e187a..8740349c779 100644 --- a/server/src/main/java/com/metamx/druid/coordination/ServerManager.java +++ b/server/src/main/java/com/metamx/druid/coordination/ServerManager.java @@ -196,7 +196,10 @@ public class ServerManager implements QuerySegmentWalker oldQueryable.close(); } catch (IOException e) { - log.makeAlert(e, "Unable to close segment %s", segment.getIdentifier()).emit(); + log.makeAlert(e, "Exception closing segment") + .addData("dataSource", dataSource) + .addData("segmentId", segment.getIdentifier()) + .emit(); } } else { log.info( diff --git a/server/src/test/java/com/metamx/druid/index/ReferenceCountingSegmentTest.java b/server/src/test/java/com/metamx/druid/index/ReferenceCountingSegmentTest.java index c4c6b2ecd04..a9b6c398a57 100644 --- a/server/src/test/java/com/metamx/druid/index/ReferenceCountingSegmentTest.java +++ b/server/src/test/java/com/metamx/druid/index/ReferenceCountingSegmentTest.java @@ -129,6 +129,8 @@ public class ReferenceCountingSegmentTest segment.increment(); segment.increment(); segment.increment(); + Assert.assertTrue(segment.getNumReferences() == 0); + segment.close(); Assert.assertTrue(segment.getNumReferences() == 0); }