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

Kafka can only send partial messages,RequestTimedOutError,KafkaTimeoutError #2439

Open
fireeeeeeeee opened this issue Jun 27, 2024 · 0 comments

Comments

@fireeeeeeeee
Copy link

My program sends a large number of messages through Kafka in the morning and afternoon(9:00-11:30,13:30-15:00). Previously, when no messages were sent at noon, I encountered the following error:

20240621 11:57:02.134539 99256 ERROR _logger.py error 2026 $ send kafka fail excp = [Error 7] RequestTimedOutError: Request timed out after 30000 ms
20240621 11:57:02.137691 99256 ERROR _logger.py error 2026 $ send kafka fail excp = KafkaTimeoutError: Batch for TopicPartition(topic='snap', partition=0) containing 49 record(s) expired: 1620 seconds have passed since batch creation plus linger time

Previously we ignored these messages because the messages were not mostly lost.But recently we also encountered this problem in the morning, and a lot of data was lost,error:

20240627 09:00:00.549644 51830 ERROR _logger.py error 2026 $ send kafka fail excp = [Error 7] RequestTimedOutError: Request timed out after 30000 ms
20240627 09:00:00.556055 51830 ERROR _logger.py error 2026 $ send kafka fail excp = KafkaTimeoutError: Batch for TopicPartition(topic='snap', partition=0) containing 81 record(s) expired: 58 seconds have passed since last append

The way I use the producer is very simple:

self.producer = KafkaProducer(bootstrap_servers=json_config["kafka_host"].split(','), value_serializer=lambda m: m.SerializeToString())
def on_send_error(excp):
wylogger.error(f'send kafka fail excp = {excp} ')
self.producer.send(self.topic, self.snap).add_errback(on_send_error)

extra information:
1.We started three programs use kafka on one machine and sent three topics
2.We bound the program to the kernel and solved the problem yesterday, but it failed again today.

Could anybody give me some help? Thanks a lot

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

1 participant