Skip to content

can not kill server when subscribed to kafka topic receiving no messages

If the kafka backend is subscribed to a topic on which no messages are being produced, the server can not be killed by normal KeyboardInterrupt signals. Presumably this is because the server is spending it's entire time in the underlying Consumer.poll(), which is blocking, and not in python. If the server is sent a TERM signal from e.g. kill, then the server will terminate.

Not sure what to do about this other than not using poll to block for the full timeout time.