Compare commits

...

1 Commits

Author SHA1 Message Date
akwizgran
8711e4782d Write any records in the queue before ending session. 2020-06-01 15:49:21 +01:00
2 changed files with 6 additions and 0 deletions

View File

@@ -166,6 +166,9 @@ class DuplexOutgoingSession implements SyncSession, EventListener {
dataToFlush = true; dataToFlush = true;
} }
} }
// Write any records that were already in the queue
ThrowingRunnable<IOException> task;
while ((task = writerTasks.poll()) != null) task.run();
streamWriter.sendEndOfStream(); streamWriter.sendEndOfStream();
} catch (InterruptedException e) { } catch (InterruptedException e) {
LOG.info("Interrupted while waiting for a record to write"); LOG.info("Interrupted while waiting for a record to write");

View File

@@ -95,6 +95,9 @@ class SimplexOutgoingSession implements SyncSession, EventListener {
if (task == CLOSE) break; if (task == CLOSE) break;
task.run(); task.run();
} }
// Write any records that were already in the queue
ThrowingRunnable<IOException> task;
while ((task = writerTasks.poll()) != null) task.run();
streamWriter.sendEndOfStream(); streamWriter.sendEndOfStream();
} catch (InterruptedException e) { } catch (InterruptedException e) {
LOG.info("Interrupted while waiting for a record to write"); LOG.info("Interrupted while waiting for a record to write");