Skip to content

Commit d34bf99

Browse files
authored
Persistent workers: exit if stdin is closed (#472)
Currently, the Kotlin persistent worker goes into an infinite loop when stdin is closed. It keeps trying to parse the input, but nothing is read, so it keeps getting a `null` pointer, and then tries, tries again.
1 parent 6dbf7fd commit d34bf99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/io/bazel/kotlin/builder/tasks/BazelWorker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class PersistentWorker(
158158

159159
override fun run(args: List<String>): Int {
160160
while (true) {
161-
val request = WorkRequest.parseDelimitedFrom(io.input) ?: continue
161+
val request = WorkRequest.parseDelimitedFrom(io.input) ?: break
162162

163163
val (status, exit) = WorkingDirectoryContext.newContext()
164164
.runCatching {

0 commit comments

Comments
 (0)