Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug: Spurious "Workspace Marked for Deletion" Notifications for Deleted Workspaces #20913

Closed
Assignees
DanielleMaywood
@bjornrobertsson

Description

@bjornrobertsson

I have searched for similar issues.

Secondary effect is log lines where the logging methods fail (i.e. WebHooks) causes a fair amount of noise/retries.

Description

When a template's dormancy settings are enabled or disabled, the system sends out "Workspace marked for deletion" notifications. These notifications are being sent for all dormant workspaces associated with the template, including those that have already been deleted. This results in users receiving a large volume of confusing and irrelevant notifications.

The root cause is that the database query responsible for identifying workspaces to update does not filter out workspaces that are already in a "deleted" state.

Steps to Reproduce

  1. Create a template.
  2. Create a workspace from this template.
  3. Delete the workspace.
  4. Enable or modify the "Time until dormant auto-deletion" setting on the template.
  5. Observe that a "Workspace marked for deletion" notification is sent for the already-deleted workspace.

Expected Behavior

When a template's dormancy settings are changed, notifications should only be sent for active, dormant workspaces that are affected by the change. No notifications should be sent for workspaces that have already been deleted.

Actual Behavior

Notifications are sent for all dormant workspaces associated with the template, including those that have already been deleted.

Affected Functions and Files for Review

Based on the analysis, the following files and functions are relevant to this issue and may need review:

  • coder/coderd/database/queries.sql.go:

    • The SQL queryupdateWorkspacesDormantDeletingAtByTemplateID is the primary source of the issue. It needs to be modified to filter out deleted workspaces by addingAND deleted = false to theWHERE clause.
  • coder/enterprise/coderd/schedule/template.go:

    • TheSet method inEnterpriseTemplateScheduleStore calls the aforementioned database query and then enqueues the notifications. This is the high-level logic that orchestrates the faulty behavior.
  • coder/coderd/autobuild/lifecycle_executor.go:

    • This file contains related logic for workspace lifecycle management and may be worth reviewing to ensure consistency.
  • coder/coderd/templates.go andcoder/coderd/workspaces.go:

    • These files handle API requests related to templates and workspaces and are part of the call chain.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp