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
@AkihiroSuda AkihiroSuda added this to the v2.0.0 milestone Oct 8, 2025
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit c641f27 into lima-vm:master Oct 8, 2025
88 of 90 checks passed
@norio-nomura norio-nomura deleted the ensure-closing-hostagent-before-canceling-context branch October 8, 2025 10:01
@norio-nomura
Copy link
Contributor Author

Thanks! 🙏🏻

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.

2 participants