ctubbsii commented on a change in pull request #1318: Fix #1314 fixes gc thread issue by creating one timed task instance URL: https://github.com/apache/accumulo/pull/1318#discussion_r312584634
########## File path: server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java ########## @@ -90,20 +89,13 @@ * @param useTrash * true to move files to trash rather than delete them */ - GarbageCollectWriteAheadLogs(final AccumuloServerContext context, VolumeManager fs, - boolean useTrash) throws IOException { + GarbageCollectWriteAheadLogs(final AccumuloServerContext context, final VolumeManager fs, + final LiveTServerSet liveServers, boolean useTrash) throws IOException { this.context = context; this.fs = fs; this.useTrash = useTrash; - this.liveServers = new LiveTServerSet(context, new Listener() { - @Override - public void update(LiveTServerSet current, Set<TServerInstance> deleted, - Set<TServerInstance> added) { - log.debug("New tablet servers noticed: " + added); - log.debug("Tablet servers removed: " + deleted); - } - }); - liveServers.startListeningForTabletServerChanges(); + this.liveServers = liveServers; Review comment: The choice is to decide whether `startListeningForTabletServerChanges()` in a single background task every 5 seconds is better, or calling `scanServers()` immediately before using the set is better. I don't know that one is significantly easier to reason about than the other. In both scenarios we are getting a relatively recent view of the current live tservers. But, I do like avoiding the background task if we don't actually need it. SimpleTimer is dubious. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services