You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "thomas-bousquet (via GitHub)" <gi...@apache.org> on 2025/12/01 21:29:53 UTC
[PR] fix: return error when the client transaction coordinator is nil to p… [pulsar-client-go]
thomas-bousquet opened a new pull request, #1444:
URL: https://github.com/apache/pulsar-client-go/pull/1444
### Motivation
When the Pulsar client is created, if `EnableTransaction` is `true` then the transaction coordinator client is created.
If an application tries to create a transaction with `NewTransaction()` when `EnableTransaction` is `false`, the application will panic; returning an error when the transaction coordinator is `nil` will prevent this.
### Modifications
In `NewTransaction()`, a nil check is added . If the transaction coordination client is `nil`, the method now returns an error.
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
This change is a trivial rework / code cleanup without any test coverage.
### Does this pull request potentially affect one of the following parts:
*If `yes` was chosen, please highlight the changes*
- Dependencies (does it add or upgrade a dependency): no
- The public API: no
- The schema: no
- The default values of configurations: no
- The wire protocol: no
### Documentation
- Does this pull request introduce a new feature? no
--
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.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: return error when the client transaction coordinator is nil to p… [pulsar-client-go]
Posted by "crossoverJie (via GitHub)" <gi...@apache.org>.
crossoverJie commented on PR #1444:
URL: https://github.com/apache/pulsar-client-go/pull/1444#issuecomment-3600211651
Please add a unit test.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: return error when the client transaction coordinator is nil to p… [pulsar-client-go]
Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece merged PR #1444:
URL: https://github.com/apache/pulsar-client-go/pull/1444
--
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.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: return error when the client transaction coordinator is nil to p… [pulsar-client-go]
Posted by "thomas-bousquet (via GitHub)" <gi...@apache.org>.
thomas-bousquet commented on PR #1444:
URL: https://github.com/apache/pulsar-client-go/pull/1444#issuecomment-3603386416
> Please add a unit test.
I added a test in the integration tests suite for transactions. I also exported the error, as it could be leveraged with `errors.Is()` by the applications creating the client
--
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.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org