Skip to content
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

Merged
merged 3 commits into from
Mar 10, 2020

Conversation

mrooz
Copy link
Contributor

@mrooz mrooz commented Jun 27, 2019

No description provided.

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
Copy link
Collaborator

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

Copy link
Contributor Author

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix comment

Copy link
Contributor Author

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)
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@ollana ollana merged commit 4da4b1a into intuit:master Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants