Skip to content

Environment deletion#3466

Merged
mschuwalow merged 8 commits into
mainfrom
environment-deletion
May 19, 2026
Merged

Environment deletion#3466
mschuwalow merged 8 commits into
mainfrom
environment-deletion

Conversation

@mschuwalow
Copy link
Copy Markdown
Contributor

Ensure that agents are properly stopped on environment deletion (not just component deletion).

This is a first step in allowing to investigate and shut down misbehaving applications as admins.

@mschuwalow mschuwalow self-assigned this May 18, 2026
FROM components c
JOIN component_revisions cr ON c.component_id = cr.component_id
WHERE c.component_id = $1 AND cr.revision_id = $2 AND ($3 OR c.deleted_at IS NULL)
JOIN environments e ON e.environment_id = c.environment_id
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The semantics here changed such that include_deleted means "include if the entity itself is deleted, but still exclude it if any parent is deleted)

@mschuwalow mschuwalow force-pushed the environment-deletion branch from aa6fe6b to a7fb72c Compare May 18, 2026 14:49
InitialAgentFileDownloadFailed initial_agent_file_download_failed = 24;
FileSystemError file_system_error = 25;
InvocationFailed invocation_failed = 26;
ComponentNotFound component_not_found = 5;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The new WorkerExecutorError::ComponentNotFound is not handled in:

  • From<WorkerExecutorError> for ApiEndpointError — falls through to INTERNAL_UNKNOWN (HTTP 500).
  • From<WorkerServiceError> for agent_error::Error for GolemError(WorkerExecutorError::ComponentNotFound { .. }) — falls through to InternalError.
  • golem-worker-service/src/service/worker/routing_logic.rs should likely treat it as Expected(...) so it isn't logged/metered as an internal failure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. This should normally not reach the worker service outside very specific timings (as the auth check will fail before it reaches the executor), but better to clean it up 👍

@vigoo
Copy link
Copy Markdown
Contributor

vigoo commented May 18, 2026

I noticed that the EnvironmentDeleted event handler in the executor only invalidates the current_component_metadata_cache and not the component_metadata_cache (pre-existing issue), could you fix it in this pr?

@mschuwalow mschuwalow requested a review from vigoo May 18, 2026 17:05
@mschuwalow mschuwalow merged commit 24d0b5b into main May 19, 2026
51 checks passed
@mschuwalow mschuwalow deleted the environment-deletion branch May 19, 2026 09:01
@github-actions github-actions Bot locked and limited conversation to collaborators May 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants