diff --git a/src/main/java/com/nucleodb/library/database/tables/table/ModQueueHandler.java b/src/main/java/com/nucleodb/library/database/tables/table/ModQueueHandler.java index 4ad9eda..23ab2e8 100644 --- a/src/main/java/com/nucleodb/library/database/tables/table/ModQueueHandler.java +++ b/src/main/java/com/nucleodb/library/database/tables/table/ModQueueHandler.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.util.Queue; +import java.util.concurrent.ExecutionException; import java.util.logging.Logger; class ModQueueHandler implements Runnable { @@ -21,7 +22,11 @@ public void run() { while (true) { int left = 0; while (!modqueue.isEmpty() && (mqi = modqueue.poll()) != null) { - this.dataTable.modify(mqi.getMod(), mqi.getModification()); + try { + this.dataTable.modify(mqi.getMod(), mqi.getModification()); + } catch (ExecutionException e) { + throw new RuntimeException(e); + } int leftTmp = dataTable.getLeftInModQueue().decrementAndGet(); if (left == leftTmp) { overkillCheck = true; diff --git a/src/test/java/com/nucleodb/library/mqs/QueueHandlerTest.java b/src/test/java/com/nucleodb/library/mqs/QueueHandlerTest.java index 3a57ce1..316159b 100644 --- a/src/test/java/com/nucleodb/library/mqs/QueueHandlerTest.java +++ b/src/test/java/com/nucleodb/library/mqs/QueueHandlerTest.java @@ -15,6 +15,7 @@ import java.io.IOException; import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicInteger; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -32,7 +33,7 @@ public void setup() { } @Test - public void testRun_method() throws IOException { + public void testRun_method() throws IOException, ExecutionException { // Define mocks, for testing different branches of the run method // Mock for the database modification branch