-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update add queue feature with a more changes and concurrent safety #410
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,8 @@ func (m *clientMonitor) Start(ctx context.Context) error { | |
// uninitialized. Unlike SetProducerStatus, it does not broadcast the change | ||
// and is only meant to be used during initial client startup. | ||
func (m *clientMonitor) InitializeProducerStatus(queueName string) { | ||
m.statusSnapshotMu.Lock() | ||
defer m.statusSnapshotMu.Unlock() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Found I needed to add this mutex when trying to run my new stress test. Most other client monitor functions already lock it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. As this wasn't dynamic before it wasn't really needed. |
||
m.currentSnapshot.Producers[queueName] = componentstatus.Uninitialized | ||
} | ||
|
||
|
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.
Taking a function pointer here might seem a little weird, but it lets us not internalize a
client
instance, which lets us avoid putting aTTx
generic parameter onqueueBundle
.