Skip to content

Commit 69e28aa

Browse files
authored
Merge pull request #1640 from NASA-AMMOS/fix/resource-streaming-jobs
Bugfix: Allow resource streaming jobs to finish before closing connections
2 parents 3e4f225 + c4fa9a9 commit 69e28aa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

merlin-worker/src/main/java/gov/nasa/jpl/aerie/merlin/worker/postgres/PostgresProfileStreamer.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ public void accept(final ResourceProfiles resourceProfiles) {
2727

2828
@Override
2929
public void close() {
30-
queryQueue.shutdown();
31-
try {
32-
queryHandler.close();
33-
} catch (SQLException e) {
34-
throw new DatabaseException("Error occurred while attempting to close PostgresProfileQueryHandler", e);
35-
}
30+
queryQueue.close(); // This waits for all submitted jobs to complete before returning
31+
try {
32+
queryHandler.close();
33+
} catch (SQLException e) {
34+
throw new DatabaseException("Error occurred while attempting to close PostgresProfileQueryHandler", e);
35+
}
3636
}
3737

3838
}

0 commit comments

Comments
 (0)