You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "michaeljmarshall (via GitHub)" <gi...@apache.org> on 2023/07/06 23:08:45 UTC
[GitHub] [pulsar] michaeljmarshall opened a new pull request, #20747: [fix][broker] call ServerCnx#closProducer from correct thread
michaeljmarshall opened a new pull request, #20747:
URL: https://github.com/apache/pulsar/pull/20747
### Motivation
The `ServerCnx#closeProducer` method must be called from the `ServerCnx`'s netty executor because it modifies a `HashMap`.
### Modifications
* Add an `assert` call to verify the correct thread calls the `closeProducer` method
* Fix the cluster migration code that calls the `closeProducer` method
### Verifying this change
The `ClusterMigrationTest` covers this change. It fails without the complete change.
### Documentation
- [x] `doc-not-needed`
--
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] call ServerCnx#closeProducer from correct thread [pulsar]
Posted by "rdhabalia (via GitHub)" <gi...@apache.org>.
rdhabalia commented on code in PR #20747:
URL: https://github.com/apache/pulsar/pull/20747#discussion_r1357358858
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##########
@@ -2933,6 +2933,7 @@ protected void interceptCommand(BaseCommand command) throws InterceptException {
@Override
public void closeProducer(Producer producer) {
+ assert ctx.executor().inEventLoop();
Review Comment:
I don't think this is right fix. there are usecases where adding producer fails and broker wants to close producer in different threads and this skips the closing the producer. using same thread must not be the limitation in this usecase that will cause other issues in async processing as other threads can complete the producer creation/failure. I think right fix will be make `recentlyClosedProducers` thread-safe as it's not being accessed in critical path and won't be the bottleneck.
--
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
[GitHub] [pulsar] lhotari merged pull request #20747: [fix][broker] call ServerCnx#closeProducer from correct thread
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #20747:
URL: https://github.com/apache/pulsar/pull/20747
--
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