Skip to content

Commit

Permalink
allow initiating peer to close stream gracefully
Browse files Browse the repository at this point in the history
I have a usecase where I would like to remove a worker without killing
it. Currently, trying to disconnect from the head node will cause the
message handler loop to throw a fatal exception, so this adds a check
that the connection is still open when trying to read new messages.
  • Loading branch information
simeonschaub committed Oct 31, 2023
1 parent 8799660 commit 8923a40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/process_messages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function message_handler_loop(r_stream::IO, w_stream::IO, incoming::Bool)

readbytes!(r_stream, boundary, length(MSG_BOUNDARY))

while true
while !(incoming && eof(r_stream))
reset_state(serializer)
header = deserialize_hdr_raw(r_stream)
# println("header: ", header)
Expand Down

0 comments on commit 8923a40

Please sign in to comment.