-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Issue 10181: Transactions: broker side NullPointerException in case of enableTransactionCoordinator=false #10182
Conversation
…f enableTransactionCoordinator=false
for reference, this is the new error on the client side:
|
ServiceUnitNotReadyException ex = | ||
new ServiceUnitNotReadyException("Transaction manager is not started or not enabled"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return ServiceUnitNotReadyException here is not reasonable here. We have defined NotAllowedError
and TransactionCoordinatorNotFound
in the PulsarApi.proto. If the broker disabled the TC, we should return NotAllowedError to the client, so that the client should not to retry to open a transaction. And if in some cases the transactionMetadataStoreService is null(In principle this shouldn't happen), we can return TransactionCoordinatorNotFound
to the client.
ping @congbobo184 Could you please help review this PR? |
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Outdated
Show resolved
Hide resolved
@codelipenghui @congbobo184 thanks for your suggestions |
/pulsarbot rerun-failure-checks |
@codelipenghui PTAL again |
/pulsarbot rerun-failure-checks |
Fixes #10181
Modifications
Prevent the NPE to bubble up
This change is a trivial rework / code cleanup without any test coverage.