Skip to content

Conversation

@ashie
Copy link
Contributor

@ashie ashie commented Dec 16, 2020

Since it is locked only when writing, it may be closed by anothre thread
while reading or writing. In actual we often get the following error
when we are processing massive messages by fluent-plugin-mqtt-io:

IOError,stream closed in another thread

This commit ensure to protect all atomic operations of the socket.

@ashie
Copy link
Contributor Author

ashie commented Dec 16, 2020

It's a revised patch of #129.

@ashie
Copy link
Contributor Author

ashie commented Dec 16, 2020

The patch can be simplified by using Thread::Mutex#owned? but I don't use it because it's breaks CI on Ruby 1.9.3.

ashie added 2 commits March 18, 2021 11:22
Since it is locked only when writing, it may be closed by anothre thread
while reading or writing. In actual we often get the following error
when we are processing massive messages by fluent-plugin-mqtt-io:

  IOError,stream closed in another thread

This commit ensure to protect all atomic operations of the socket.

Signed-off-by: Takuro Ashie <[email protected]>
Although an error should be always raised on exiting @read_thread to
break `get` loop, there was a case that it's not raised.

Signed-off-by: Takuro Ashie <[email protected]>
@ashie ashie force-pushed the client-socket-lock branch from 5e3356d to 683ce8a Compare March 18, 2021 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant