Skip to content

Commit 320d9dc

Browse files
authored
fix coroutine job memory leak [0] (#150)
1 parent 4f51ccd commit 320d9dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

client/src/main/kotlin/io/hstream/impl/BufferedProducerKtImpl.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@ class BufferedProducerKtImpl(
109109
shardAppendBytesSize.remove(shardId)
110110
timerServices[shardId]?.cancel(true)
111111
timerServices.remove(shardId)
112-
val job = shardAppendJobs[shardId]
112+
var job = shardAppendJobs[shardId]
113113
shardAppendJobs[shardId] = batchScope.launch {
114114
job?.join()
115+
job = null
115116
writeShard(shardId, records, futures)
116117
logger.info("wrote batch for shard:$shardId")
117118
flowController?.release(recordsBytesSize)

0 commit comments

Comments
 (0)