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

Fix memory leak and optimize memory usage #88

Merged
merged 3 commits into from
Feb 6, 2020
Merged

Conversation

sijie
Copy link
Member

@sijie sijie commented Feb 6, 2020

Motivation

There is a memory leak in MessageRecordUtils.

Modifications

  • Fix the memory leak in MessageRecordUtils
  • Avoid memory allocation when serializing the response
  • Optimize the reference counting for kafka request holding the payload reference

*Motivation*

There is a memory leak in MessageRecordUtils.

*Modifications*

- Fix the memory leak in MessageRecordUtils
- Avoid memory allocation when serializing the response
- Optimize the reference counting for kafka request holding the payload reference
@sijie sijie added the type/bug label Feb 6, 2020
@sijie sijie added this to the 0.0.1 milestone Feb 6, 2020
@sijie sijie requested a review from jiazhai February 6, 2020 11:48
@sijie sijie self-assigned this Feb 6, 2020
@jiazhai jiazhai merged commit 0e376d5 into master Feb 6, 2020
@jiazhai jiazhai deleted the fix_memory_issue branch February 6, 2020 13:34
@jiazhai jiazhai modified the milestones: 0.0.1, 0.1.0 Feb 17, 2020
Demogorgon314 pushed a commit to Demogorgon314/kop that referenced this pull request Oct 30, 2023
)

Master issue: streamnative/ksn#63

### Modifications

Replace the `KafkaRequestAndHeader` with the `InflightRequest`
implementation, which supports storing a raw buffer without parsing it
to an `AbstractRequest`.

For `FindCoordinator` request, since the proxy itself can act as the
coordinator broker, just return a success response without forwarding
the request to broker.

Based on the `InflightRequest`, forwarding the following requests
directly to a group coordinator broker, which is unique for a specific
consumer:
- JoinGroup
- SyncGroup
- LeaveGroup
- OffsetFetch
- OffsetCommit
- Heartbeat

Then, handles the `ListOffsets` and `Fetch` requests by forwarding them
to leader broker. Add `testConsume` to verify it works.

### Next step

- Add an integration test to verify the Kafka port (9092) won't be
accessed by Kafka clients when connecting proxy
- Support `ListOffsets` and `Fetch` requests with multiple brokers
- (low priority) Support `ListOffset` v0 request
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