-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
#632: Feature: KeepAlive and Timeout Support mechanism #1052
base: master
Are you sure you want to change the base?
Conversation
@@ -419,3 +457,28 @@ func (w *BaseWorker) Stop() error { | |||
w.Session.Expire() | |||
return nil | |||
} | |||
|
|||
func (w *BaseWorker) updateLastActivity() { | |||
w.lastActivityMux.Lock() |
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.
On each event on channels we're taking locks, I believe this would affect the performance adversely.
Can you please add some before/after benchmarks?
cc: @soumya-codes / @AshwinKul28 please add your inputs on this.
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.
Hey @lucifercr07
Should I write a benchmark for start method with locks and without locks in updateLastActivity function?
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.
Yes, ideally we should analyse the perf impact.
cc: @soumya-codes @AshwinKul28 thoughts?
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.
Ok. Will add those benchmarks
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.
Hey @lucifercr07
Can you guide me on how can I mock the base worker in benchmark?
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.
Hello @lucifercr07
I have ran the benchmarks with and without locks in the updateActivityMethod.
@Dev79844 we already have the timeout capability added to the connection instance itself. Can we figure out similar way to add keepalive? |
Hey @soumya-codes |
Hey @lucifercr07 @soumya-codes @apoorvyadav1111 |
Issue: #632
Summary:
Added timeouts and keep alive mechanism for workers.
Changes:
Added client and connection in worker struct
Added functions related to keep alive and timeouts in workers.go