Skip to content

Conversation

@mirkoCrobu
Copy link
Contributor

Motivation

Change description

Adding API endpoint PUT /v1/system/update/stop.
It stops service and platform updates.

The update cancellation is implemented via a SIGTERM signal (context cancellation) to allow for a graceful shutdown.

apt-get, In some phases, traps this signal to complete its current critical operation before exiting, delaying the interruption.

Additional Notes

Test

  • Installing orchestrator with new features
  • Start listening to events
    curl -X GET localhost:8800/v1/system/update/events
  • Start updates
    curl -X PUT localhost:8800/v1/system/update/apply
  • After 0,5 -1-3 seconds, stop updates
    curl -X PUT localhost:8800/v1/system/update/stop

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@mirkoCrobu mirkoCrobu self-assigned this Nov 12, 2025
@mirkoCrobu mirkoCrobu requested a review from a team November 12, 2025 14:47
return func(yield func(string, error) bool) {
outputWriter := orchestrator.NewCallbackWriter(func(line string) {
if !yield(line, nil) {
err := cmd.Kill()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a force kill here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, after conducting some tests, we observed that runWithContext wasn't triggering the kill, so we decided to explicitly implement it

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