-
Notifications
You must be signed in to change notification settings - Fork 17
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
Timed out operations are removed from funnel #6
Conversation
sync upstream repo
funnel.go
Outdated
@@ -38,6 +42,12 @@ type operationInProcess struct { | |||
|
|||
// The result from executing of operation, will be available after the channel will be closed. | |||
opResult | |||
|
|||
// true when this operation has been deleted from the funnel | |||
deleted abool.AtomicBool |
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.
according to "abool" documentation, we should use pointer to avoid copy
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 idea, thanks.
funnel.go
Outdated
op, found := f.opInProcess[operationId] | ||
if !found { | ||
panic("unexpected behavior, operation id not found") | ||
//Check if the operation completed after a timeout which would result in the operation being deleted from the funnelhas already deleted the the operation from the funnel. |
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.
fix comment
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.
Done.
wg.Wait() | ||
|
||
elapsedTimeAllRequests :=time.Since(start) | ||
expectedOperationTimeoutWithGrace:= funnelTimeout + time.Duration(100*time.Millisecond) |
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.
expectedOperationTimeoutWithGrace would be 600 milliseconds, when operationSleepTime is 550. The test doesn't insure the operation ended with a timeout.
Im suggesting to validate that timeout error returned for each request.
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.
I'm assuming funnel timeout is working. Perhaps we need additional tests to assure this.
No description provided.