Skip to content

Fixed a race condition in one of the examples#2706

Merged
devinrsmith merged 2 commits intodeephaven:mainfrom
SuperTails:go-client-example-fix
Aug 1, 2022
Merged

Fixed a race condition in one of the examples#2706
devinrsmith merged 2 commits intodeephaven:mainfrom
SuperTails:go-client-example-fix

Conversation

@SuperTails
Copy link
Copy Markdown
Contributor

In the input table example code, I added some rows to an input table and then immediately snapshotted a table derived from it. Sometimes the server doesn't have time to propogate the new rows, though, so the snapshot returns the wrong data.

This fix just snapshots in a loop until we find the correct data. I don't use an explicit timeout here to keep the example simple. go test has a default timeout of 1 minute so we don't have to worry about CI hanging.

@SuperTails SuperTails requested a review from devinrsmith July 30, 2022 01:18
@SuperTails SuperTails added bug Something isn't working NoDocumentationNeeded labels Jul 30, 2022
@SuperTails SuperTails self-assigned this Jul 30, 2022
return
}
defer outputRec.Release()
for {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm worried about an infinite loop. At the very least, some sort of limiter. @rcaudy, I'm surprised that upon completion of AddTable that the data might not be available for snapshotting?

@SuperTails SuperTails requested a review from devinrsmith August 1, 2022 21:16
@devinrsmith devinrsmith merged commit 1f7da53 into deephaven:main Aug 1, 2022
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working NoDocumentationNeeded

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants