Skip to content

Conversation

pulak-opti
Copy link
Contributor

@pulak-opti pulak-opti commented Jul 5, 2023

Ticket: FSSDK-8501

@pulak-opti pulak-opti marked this pull request as ready for review July 5, 2023 15:40
@pulak-opti pulak-opti requested a review from a team as a code owner July 5, 2023 15:40
Copy link
Contributor

@mikechu-optimizely mikechu-optimizely left a comment

Choose a reason for hiding this comment

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

LGTM.

I posted just a few questions, mostly because I don't know Go too well.

@yasirfolio3
Copy link
Contributor

Are we sure we need this change? I think this is already part of sdk implementation, this test also verifies it: https://github.com/optimizely/go-sdk/blob/master/pkg/event/processor_test.go#L348 unless we are trying something else here? eg.TerminateAndWait() makes sure all events are dispatched before close is completed.

@pulak-opti
Copy link
Contributor Author

Are we sure we need this change? I think this is already part of sdk implementation, this test also verifies it: https://github.com/optimizely/go-sdk/blob/master/pkg/event/processor_test.go#L348 unless we are trying something else here? eg.TerminateAndWait() makes sure all events are dispatched before close is completed.

Actually, this is the go routine https://github.com/optimizely/go-sdk/blob/master/pkg/event/dispatcher.go#L99 which fails to finish dispatching all queued events for a sudden client.Close()

and this is called here https://github.com/optimizely/go-sdk/blob/master/pkg/event/processor.go#L323

Copy link
Contributor

@yasirfolio3 yasirfolio3 left a comment

Choose a reason for hiding this comment

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

LGTM, just some minor suggestions. Also, please update the file headers with 2023

@pulak-opti pulak-opti merged commit 9c40bf9 into master Jul 6, 2023
@pulak-opti pulak-opti deleted the pulak/graceful-close branch July 6, 2023 17:34
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