Ian Maxon has submitted this change and it was merged. Change subject: ASTERIXDB-1460: Fix log level crashing CC on start ......................................................................
ASTERIXDB-1460: Fix log level crashing CC on start The Hyracks CC would nullpoint on startup if the log level was greater than FINEST. This works around the core issue that's in ASTERIXDB-1460 since in this instance the way the log level was used would cause the CC to fail on startup where the log level was equal to or greater than FINEST. Change-Id: I720eca41fac312fc6cbdbb880162a5bc8b0357dc Reviewed-on: https://asterix-gerrit.ics.uci.edu/870 Reviewed-by: Jenkins <[email protected]> Reviewed-by: Murtadha Hubail <[email protected]> Tested-by: Jenkins <[email protected]> --- M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/work/WorkQueue.java 1 file changed, 8 insertions(+), 7 deletions(-) Approvals: Murtadha Hubail: Looks good to me, approved Jenkins: Looks good to me, but someone else must approve; Verified diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/work/WorkQueue.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/work/WorkQueue.java index 7786db7..1f61543 100644 --- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/work/WorkQueue.java +++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/work/WorkQueue.java @@ -28,7 +28,8 @@ public class WorkQueue { private static final Logger LOGGER = Logger.getLogger(WorkQueue.class.getName()); - private static final Level COUNT_LOGGING_LEVEL = Level.FINEST; + //to be fixed when application vs. hyracks log level issues are sorted + private static final boolean DEBUG = false; private final LinkedBlockingQueue<AbstractWork> queue; private final WorkerThread thread; @@ -48,7 +49,7 @@ thread = new WorkerThread(); stopSemaphore = new Semaphore(1); stopped = true; - if (LOGGER.isLoggable(COUNT_LOGGING_LEVEL)) { + if(DEBUG) { enqueueCount = new AtomicInteger(0); dequeueCount = new AtomicInteger(0); } @@ -60,7 +61,7 @@ } catch (InterruptedException e) { throw new HyracksException(e); } - if (LOGGER.isLoggable(COUNT_LOGGING_LEVEL)) { + if (DEBUG) { enqueueCount.set(0); dequeueCount.set(0); } @@ -85,8 +86,8 @@ } public void schedule(AbstractWork event) { - if (LOGGER.isLoggable(COUNT_LOGGING_LEVEL)) { - LOGGER.log(COUNT_LOGGING_LEVEL, "Enqueue (" + hashCode() + "): " + enqueueCount.incrementAndGet()); + if (DEBUG) { + LOGGER.log(Level.FINEST, "Enqueue (" + hashCode() + "): " + enqueueCount.incrementAndGet()); } if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Scheduling: " + event); @@ -120,8 +121,8 @@ } catch (InterruptedException e) { continue; } - if (LOGGER.isLoggable(COUNT_LOGGING_LEVEL)) { - LOGGER.log(COUNT_LOGGING_LEVEL, + if (DEBUG) { + LOGGER.log(Level.FINEST, "Dequeue (" + WorkQueue.this.hashCode() + "): " + dequeueCount.incrementAndGet() + "/" + enqueueCount); } -- To view, visit https://asterix-gerrit.ics.uci.edu/870 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I720eca41fac312fc6cbdbb880162a5bc8b0357dc Gerrit-PatchSet: 5 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Ian Maxon <[email protected]> Gerrit-Reviewer: Ian Maxon <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]>
