Skip to content

Keep every consumer thread when thread > 1 - #541

Open
Shriraj1901 wants to merge 1 commit into
segmentio:masterfrom
Shriraj1901:fix-client-thread-consumers
Open

Shriraj1901 wants to merge 1 commit into
segmentio:masterfrom
Shriraj1901:fix-client-thread-consumers

Conversation

@Shriraj1901

Copy link
Copy Markdown

Client.init reset self.consumers to an empty list on each pass of the loop that starts the consumer threads, so with thread=N only the last consumer stayed in the list. join() and shutdown() pause and join the consumers in that list, which meant the other N-1 threads were never stopped and kept running after shutdown.

Create the list once, before the loop, and add a regression test that checks all consumers are kept and are stopped by shutdown().

Client.__init__ reset self.consumers to an empty list on each pass of the
loop that starts the consumer threads, so with thread=N only the last
consumer stayed in the list. join() and shutdown() pause and join the
consumers in that list, which meant the other N-1 threads were never
stopped and kept running after shutdown.

Create the list once, before the loop, and add a regression test that
checks all consumers are kept and are stopped by shutdown().

This branch has not been deployed

No deployments
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