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 2019/12/08 07:34:00 UTC

[jira] [Commented] (KAFKA-9287) Transaction completion may block unnecessarily after abortable error

    [ https://issues.apache.org/jira/browse/KAFKA-9287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16990764#comment-16990764 ] 

ASF GitHub Bot commented on KAFKA-9287:
---------------------------------------

hachikuji commented on pull request #7799: KAFKA-9287; Fix unneeded delay before failing pending transaction commit
URL: https://github.com/apache/kafka/pull/7799
 
 
   It is possible for the user to call `commitTransaction` before a pending `AddPartitionsToTxn` call has returned. If the `AddPartitionsToTxn` call returns an abortable error, we need to cancel any pending batches in the accumulator and we need to fail the pending commit. The problem in this case is that `Sender.runOnce`, after failing the batches, enters `NetworkClient.poll` before it has a chance to cancel the commit. Since there are no pending requests at this time, this will block unnecessarily and prevent completion of the doomed commit. This patch fixes the problem by returning from `runOnce` if any batches have been aborted, which allows the commit to also fail without the delay.
   
   Note that this was the cause of the delay executing `AuthorizerIntegrationTest.testTransactionalProducerTopicAuthorizationExceptionInCommit` compared to other tests in this class. After fixing the bug, the delay is gone and the test time is similar to other test cases in the class.
   
   ### 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 to 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


> Transaction completion may block unnecessarily after abortable error
> --------------------------------------------------------------------
>
>                 Key: KAFKA-9287
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9287
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Jason Gustafson
>            Assignee: Jason Gustafson
>            Priority: Major
>
> This was discovered while investigating the delay in `AuthorizerIntegrationTest.testTransactionalProducerTopicAuthorizationExceptionInCommit` which typically takes 35 seconds rather than 5 seconds like most of these other tests in this class. There is an edge case on transaction completion if an AddPartitionsToTxn request fails with an abortable error in which the producer may be left blocking in `NetworkClient.poll` without failing the pending commit and without any pending requests. Ultimately the test case was blocking the full 30s request timeout before failing the transaction.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)