Skip to content

Drain queued Web Push jobs on shutdown instead of cancelling them #73

Done

Description

@markmnl

Follow-up from the review of #71. Low priority.

Hub.CloseContext cancels the push context first and then waits for the workers, so the 5 seconds allowed in cmd/fmsg-webapi/main.go bound how long workers take to notice the cancel; they are not a drain. Web Push notifications for messages committed in the last moments before shutdown are dropped, and nothing sends them later.

This is not a regression: before #71 the pushes were plain goroutines and were lost when the process exited.

If a drain is wanted: stop accepting jobs and close the queue, wait for the workers up to the deadline, and only cancel the push context when the deadline passes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions