This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 132
[fix] Use thread-safe list in TransactionMarkerChannelManager #1602
Merged
BewareMyPower
merged 1 commit into
streamnative:master
from
michaeljmarshall:use-threadsafe-list
Dec 5, 2022
Merged
[fix] Use thread-safe list in TransactionMarkerChannelManager #1602
BewareMyPower
merged 1 commit into
streamnative:master
from
michaeljmarshall:use-threadsafe-list
Dec 5, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
michaeljmarshall
requested review from
BewareMyPower and
Demogorgon314
as code owners
December 2, 2022 05:45
Codecov Report
@@ Coverage Diff @@
## master #1602 +/- ##
=========================================
Coverage 15.34% 15.34%
Complexity 592 592
=========================================
Files 164 164
Lines 11913 11913
Branches 1102 1102
=========================================
Hits 1828 1828
Misses 9931 9931
Partials 154 154
|
eolivelli
approved these changes
Dec 2, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Demogorgon314
approved these changes
Dec 2, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
BewareMyPower
approved these changes
Dec 5, 2022
michaeljmarshall
added a commit
to michaeljmarshall/kop
that referenced
this pull request
Dec 13, 2022
…native#1602) ### Motivation The `TransactionMarkerChannelManager#addTxnMarkersToBrokerQueue` method modifies an `ArrayList` from callbacks on futures, which could result in unsafe modification of the list. ### Modifications * Replace `ArrayList` with `CopyOnWriteArrayList`. I chose `CopyOnWriteArrayList` since it is simple and the expected number of writes to the list is low. (cherry picked from commit 8cddbf3)
Demogorgon314
pushed a commit
that referenced
this pull request
Feb 7, 2023
### Motivation The `TransactionMarkerChannelManager#addTxnMarkersToBrokerQueue` method modifies an `ArrayList` from callbacks on futures, which could result in unsafe modification of the list. ### Modifications * Replace `ArrayList` with `CopyOnWriteArrayList`. I chose `CopyOnWriteArrayList` since it is simple and the expected number of writes to the list is low. (cherry picked from commit 8cddbf3)
Demogorgon314
pushed a commit
that referenced
this pull request
Feb 7, 2023
### Motivation The `TransactionMarkerChannelManager#addTxnMarkersToBrokerQueue` method modifies an `ArrayList` from callbacks on futures, which could result in unsafe modification of the list. ### Modifications * Replace `ArrayList` with `CopyOnWriteArrayList`. I chose `CopyOnWriteArrayList` since it is simple and the expected number of writes to the list is low. (cherry picked from commit 8cddbf3)
Demogorgon314
pushed a commit
that referenced
this pull request
Feb 27, 2023
### Motivation The `TransactionMarkerChannelManager#addTxnMarkersToBrokerQueue` method modifies an `ArrayList` from callbacks on futures, which could result in unsafe modification of the list. ### Modifications * Replace `ArrayList` with `CopyOnWriteArrayList`. I chose `CopyOnWriteArrayList` since it is simple and the expected number of writes to the list is low. (cherry picked from commit 8cddbf3)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
cherry-picked/branch-2.9.4
cherry-picked/branch-2.10.3
cherry-picked/branch-2.11
no-need-doc
This pr does not need any document
release/2.9.4
release/2.10.3
release/2.11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The
TransactionMarkerChannelManager#addTxnMarkersToBrokerQueue
method modifies anArrayList
from callbacks on futures, which could result in unsafe modification of the list.Modifications
ArrayList
withCopyOnWriteArrayList
. I choseCopyOnWriteArrayList
since it is simple and the expected number of writes to the list is low.Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Documentation
no-need-doc
This is a simple fix.