You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/05/17 01:47:00 UTC
[jira] [Commented] (KAFKA-6897) Mirrormaker waits to shut down
forever on produce failure with abort.on.send.failure=true
[ https://issues.apache.org/jira/browse/KAFKA-6897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16478369#comment-16478369 ]
ASF GitHub Bot commented on KAFKA-6897:
---------------------------------------
dhruvilshah3 opened a new pull request #5027: KAFKA-6897: Prevent producer from blocking indefinitely on close
URL: https://github.com/apache/kafka/pull/5027
After successful completion of KafkaProducer#close, it is possible that an application calls KafkaProducer#send. If the send is invoked for a topic for which we do not have any metadata, the producer will block until `max.block.ms` elapses - we do not expect to receive any metadata update in this case because Sender (and NetworkClient) has already exited. It is only when RecordAccumulator#append is invoked that we notice that the producer has already exited. If `max.block.ms` is set to Long.MaxValue (or a sufficiently high value in general), the producer could this block infinitely.
This patch introduces the concept of "poisoned metadata". In NetworkClient#close, we poison the metadata to indicate that no further metadata updates are possible. Any consumer that is currently waiting on (or could wait for in future) for metadata updates could check the poison state of metadata and exit early, if required.
This is an early upload to get some feedback on the direction of this patch. If we agree this is the correct way to fix this issue, I will add unit tests.
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
> Mirrormaker waits to shut down forever on produce failure with abort.on.send.failure=true
> ------------------------------------------------------------------------------------------
>
> Key: KAFKA-6897
> URL: https://issues.apache.org/jira/browse/KAFKA-6897
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 1.1.0
> Reporter: Koelli Mungee
> Assignee: Dhruvil Shah
> Priority: Major
> Attachments: mirror_maker_thread_dump.log
>
>
> Mirrormaker never shuts down after a produce failure when abort.on.send.failure=true
> {code:java}
> [2018-05-07 08:29:32,417] ERROR Error when sending message to topic test with key: 52 bytes, value: 32615 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
> org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s) for test-11: 45646 ms has passed since last append
> [2018-05-07 08:29:32,434] INFO Closing producer due to send failure. (kafka.tools.MirrorMaker$)
> [2018-05-07 08:29:32,434] INFO [Producer clientId=producer-1] Closing the Kafka producer with timeoutMillis = 0 ms. (org.apache.kafka.clients.producer.KafkaProducer)
> {code}
> A stack trace of this mirrormaker process 9 hours later shows that the main thread is still active and it is waiting for metadata that it will never get since the producer send thread is no longer running.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)