Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Conversation

@BewareMyPower
Copy link
Collaborator

Motivation

Currently each connections holds two DelayedOperationPurgatory (purgatory) objects for produce and fetch requests. It's a waste of resources because each purgatory is backed by a time wheel and a reaper thread. In Kafka, these purgatories are held by a ReplicaManager instance, which is a global instance shared by all connections.

Modifications

Move producePurgatory and fetchPurgatory into KafkaProtocolHandler, and pass them to the constructors of KafkaChannelInitializer and KafkaRequestHandler. And move the shutdown calls from KafkaRequestHandler#close to KafkaProtocolHandler#close.

@BewareMyPower BewareMyPower self-assigned this Nov 12, 2021
@BewareMyPower BewareMyPower added release/2.8.1.x release/2.9.0 type/bug type/enhancement Indicates an improvement to an existing feature and removed type/bug labels Nov 12, 2021
@BewareMyPower BewareMyPower merged commit cbc46fb into streamnative:master Nov 14, 2021
@BewareMyPower BewareMyPower deleted the bewaremypower/make-purgatory-static branch November 14, 2021 14:26
BewareMyPower added a commit that referenced this pull request Nov 17, 2021
### Motivation

Currently each connections holds two `DelayedOperationPurgatory` (purgatory) objects for produce and fetch requests. It's a waste of resources because each purgatory is backed by a time wheel and a reaper thread. In Kafka, these purgatories are held by a `ReplicaManager` instance, which is a global instance shared by all connections.

### Modifications

Move `producePurgatory` and `fetchPurgatory` into `KafkaProtocolHandler`, and pass them to the constructors of `KafkaChannelInitializer` and `KafkaRequestHandler`. And move the `shutdown` calls from `KafkaRequestHandler#close` to `KafkaProtocolHandler#close`.
@BewareMyPower
Copy link
Collaborator Author

Remove label release/2.8.1.x because it relies on some changes of #864. Instead of fixing cherry-pick, I'll open a new PR to migrate this PR to branch-2.8.1.

BewareMyPower added a commit that referenced this pull request Nov 17, 2021
Cherry-picking #901 relies on some
changes of #864, while #864 cannot be
cherry-picked into branch-2.8.1 because it relies on PIP 95, which was
introduced from Pulsar 2.9.0
BewareMyPower added a commit that referenced this pull request Nov 17, 2021
### Motivation

Currently each connections holds two `DelayedOperationPurgatory` (purgatory) objects for produce and fetch requests. It's a waste of resources because each purgatory is backed by a time wheel and a reaper thread. In Kafka, these purgatories are held by a `ReplicaManager` instance, which is a global instance shared by all connections.

### Modifications

Move `producePurgatory` and `fetchPurgatory` into `KafkaProtocolHandler`, and pass them to the constructors of `KafkaChannelInitializer` and `KafkaRequestHandler`. And move the `shutdown` calls from `KafkaRequestHandler#close` to `KafkaProtocolHandler#close`.
@BewareMyPower
Copy link
Collaborator Author

Instead of opening a new PR, I pushed a commit (29440e1) to migrate the necessary changes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants