You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Leave no trace: an undrained pool's SQS queue has no deleter (#1319 follow-up) #1351
Follow-up to #1319. Owner principle (#610): anything spore.host creates, it removes once it is no longer needed.
The SQS queue of a pool that is never drained has no spawn deleter. spawn pool drain deletes the queue, the worker role and the instance profile. #1319 (PR #1350) gave abandoned pool roles a deleter through pkg/instancerole. The pool's queue (pkg/taskpool/queue.go, 12 h message retention) and any spec objects it staged are still left behind.
AWS documents that SQS may delete a queue after 30 days with no activity. That is not a deleter we control, and no spawn command removes the queue.
Proposal:spawn cleanup (and optionally the reaper) deletes a spawn-tagged pool queue (spawn:managed=true, plus the pool run-id tag) when all of these hold:
the queue is empty: ApproximateNumberOfMessages and ApproximateNumberOfMessagesNotVisible are both 0;
the queue is older than a 24 h grace period.
The reaper would need sqs:ListQueues, GetQueueAttributes, ListQueueTags and DeleteQueue, scoped to spawn's pool queue name prefix and provisioned by spore.host's own templates.
Activity
feat(cleanup,reaper): delete undrained pools' SQS queues and staged s…