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

Wait for writer response on Refresh #333

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

rollandf
Copy link
Contributor

When sending a Refresh message to Writer's refresh channel,
if the state is "Succeeded" or "Failed", the Writer will update
the sync channel when finished.

Therefore there is a need to wait on sync channel on the Daemon side
when sending "Succeeded" or "Failed".

Signed-off-by: Fred Rolland [email protected]

When sending a Refresh message to Writer's refresh channel,
if the state is "Succeeded" or "Failed", the Writer will update
the sync channel when finished.

Therefore there is a need to wait on sync channel on the Daemon side
when sending "Succeeded" or "Failed".

Signed-off-by: Fred Rolland <[email protected]>
@github-actions
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@rollandf
Copy link
Contributor Author

@fedepaol can you PTAL?

@@ -413,6 +413,8 @@ func (dn *Daemon) nodeStateSyncHandler(generation int64) error {
syncStatus: "Succeeded",
lastSyncError: "",
}
// wait for writer to refresh the status
<-dn.syncCh
Copy link
Collaborator

Choose a reason for hiding this comment

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

IIUC as SyncCh is initialized with a zero capacity. then [1] will block until someone is trying to read from the channel.

nice catch here @rollandf

[1]

syncCh <- struct{}{}

@adrianchiris
Copy link
Collaborator

/test-all

Copy link
Collaborator

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

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

Nice one!

@SchSeba SchSeba merged commit d8700d5 into k8snetworkplumbingwg:master Jul 13, 2022
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.

4 participants