Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: RecordAccumulator is closed #32

Open
LplusKira opened this issue Jan 18, 2022 · 1 comment
Open

AssertionError: RecordAccumulator is closed #32

LplusKira opened this issue Jan 18, 2022 · 1 comment

Comments

@LplusKira
Copy link

Hi guys, we got some errors like

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 1182, in run
    self.function(*self.args, **self.kwargs)
  File "/home/po-kai.chang/.local/lib/python3.6/site-packages/kafka_logger/handlers.py", line 295, in flush
    self.producer.send(self.kafka_topic_name, log)
  File "/home/po-kai.chang/.local/lib/python3.6/site-packages/kafka/producer/kafka.py", line 603, in send
    estimated_size=message_size)
  File "/home/po-kai.chang/.local/lib/python3.6/site-packages/kafka/producer/record_accumulator.py", line 247, in append
    assert not self._closed, 'RecordAccumulator is closed'
AssertionError: RecordAccumulator is closed

Any ideas?

After commenting out

self.producer.close()

There's no such error (and no other errors seen). Maybe this is related?

our handler's config is like

    bootstrap_server = "someServer"
    topic = "someTopic"
    kafka_producer_args = {
        'sasl_mechanism': "SCRAM-SHA-512"
        'sasl_plain_username': "someUserName",
        'sasl_plain_password': "somePwd",
        'acks': 0
    }
    kafka_log_handler = KafkaLoggingHandler(bootstrap_server,
                                            topic,
                                            security_protocol="SASL_SSL",
                                            ssl_cafile="someFile",
                                            kafka_producer_args=kafka_producer_args)
@bobvt
Copy link

bobvt commented Jan 21, 2022

we are getting the same exception and stack trace. it its intermittent and happens only when running in batch. its an aws sagemaker batch process. we are also using gthread; not sure if that would cause a problem with the daemon thread spawned in the handler. any thoughts???

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

No branches or pull requests

2 participants