Skip to content

Conversation

norio-nomura
Copy link
Contributor

pkg/hostagent: Avoid race on using onClose

  • Add onCloseMu
  • Add cleanUp()
  • Use onCloseMu in HostAgent.close()

pkg/hostagent:

  • Ensure calling close() before cancelling the context.
  • Use cleanUp() instead of defer to calling ClosableListeners.Close()

portfwd:

  • Change ClosableListeners.Close() to return error
  • Change Forwarder.Close() to return error

@norio-nomura
Copy link
Contributor Author

Windows tests failed to start vm with
https://github.com/lima-vm/lima/actions/runs/17964221262/job/51093408244?pr=4081#step:9:717

? Do you want to start the instance now? (Y/n) ? Do you want to start the instance now? (Y/n) ? Do you want to start the instance now? (Y/n)

🤔

@norio-nomura norio-nomura force-pushed the ensure-closing-hostagent-before-canceling-context branch 2 times, most recently from dfb49ee to 569f40c Compare September 30, 2025 01:11
- Add `HostAgent.cleanUp()`
- use `HostAgent.onCloseMu` in `HostAgent.close()`

Signed-off-by: Norio Nomura <[email protected]>
…he context.

portfwd:
- Change `ClosableListeners.Close()` to return `error`
- Change `Forwarder.Close()` to return `error`
- Use `HostAgent.cleanUp()` instead of `defer` to calling `ClosableListeners.Close()`

Signed-off-by: Norio Nomura <[email protected]>
@norio-nomura norio-nomura force-pushed the ensure-closing-hostagent-before-canceling-context branch from 569f40c to fef24e5 Compare October 2, 2025 04:52
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.

1 participant