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

HOTFIX: testInitTransactionTimeout should use prepareResponse instead of respond #8179

Merged
merged 4 commits into from
Feb 27, 2020

Conversation

abbccdda
Copy link
Contributor

@abbccdda abbccdda commented Feb 26, 2020

We have seen a flaky behavior due to using #respond instead of #prepareResponse call for the txn test.

Reproduced on local as:

[2020-02-26 15:08:49,194] ERROR [Producer clientId=producer-bad-transaction, transactionalId=bad-transaction] Uncaught error in kafka producer I/O thread:  (org.apache.kafka.clients.producer.internals.Sender:241)
java.lang.ClassCastException: org.apache.kafka.common.requests.InitProducerIdResponse cannot be cast to org.apache.kafka.common.requests.FindCoordinatorResponse
	at org.apache.kafka.clients.producer.internals.TransactionManager$FindCoordinatorHandler.handleResponse(TransactionManager.java:1494)
	at org.apache.kafka.clients.producer.internals.TransactionManager$TxnRequestHandler.onComplete(TransactionManager.java:1260)
	at org.apache.kafka.clients.ClientResponse.onComplete(ClientResponse.java:109)
	at org.apache.kafka.clients.MockClient.poll(MockClient.java:294)
	at org.apache.kafka.clients.producer.internals.Sender.maybeSendAndPollTransactionalRequest(Sender.java:458)
	at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:312)
	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:239)

and

java.lang.IllegalStateException: No requests pending for inbound response FindCoordinatorResponseData(throttleTimeMs=0, errorCode=0, errorMessage='NONE', nodeId=0, host='host1', port=1000)

	at org.apache.kafka.clients.MockClient.respond(MockClient.java:345)
	at org.apache.kafka.clients.MockClient.respond(MockClient.java:319)
	at org.apache.kafka.clients.producer.KafkaProducerTest.testInitTransactionTimeout(KafkaProducerTest.java:770)

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@ijuma
Copy link
Contributor

ijuma commented Feb 27, 2020

ok to test

@guozhangwang
Copy link
Contributor

@abbccdda Verified on local this could work. Merging to trunk now.

@guozhangwang guozhangwang merged commit 399d18f into apache:trunk Feb 27, 2020
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

Successfully merging this pull request may close these issues.

3 participants