You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2026/09/30 00:38:25 UTC
[PR] [fix][broker] Read the producer name of GetOrCreateSchema before authorization completes [pulsar]
lhotari opened a new pull request, #26770:
URL: https://github.com/apache/pulsar/pull/26770
### Motivation
`ServerCnx#handleGetOrCreateSchema` reads the producer name from the command inside the callback that runs after the asynchronous topic authorization check. The Pulsar decoder reuses the command object once the handler returns, so when authorization completes asynchronously, the fields read in the callback can belong to a later command decoded on the same connection. The replicator producer flag passed to `Topic#addSchema` can then be wrong.
### Modifications
- Compute the replicator producer flag from the producer name before the asynchronous authorization step, while the command fields are still valid, and use it in the callback.
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
This change added tests and can be verified as follows:
- Added `ServerCnxTest#testGetOrCreateSchemaKeepsProducerNameWhileAuthorizing`: a replicator producer sends `GetOrCreateSchema` while its authorization is pending, a second `GetOrCreateSchema` with an ordinary producer name is decoded before authorization completes, and the first request must add the schema with the replicator flag set. The test fails without the fix.
### Does this pull request potentially affect one of the following parts:
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
--
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][broker] Read the producer name of GetOrCreateSchema before authorization completes [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat merged PR #26770:
URL: https://github.com/apache/pulsar/pull/26770
--
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