Skip to content

FinalizedAt struct field is not set on Job for cancelled events #515

Open

Description

@allancalix

I'm subscribing to terminal job states:

	ch, cancel := rc.Subscribe(
		river.EventKindJobFailed,
		river.EventKindJobCancelled,
		river.EventKindJobCompleted)

And I noticed that the FinalizedAt struct field for Job is nil when the job is cancelled. This is confusing because other parts of the code seem to suggest that Finalized includes cancelled jobs so I would expect it to be set.

https://github.com/riverqueue/riverui/blob/93b4f537a1b64382ac359c42c8730255e9a9f446/ui/src/components/JobList.tsx#L174

Activity

  1. bgentry commented on Aug 7, 2024

    @bgentry
    Contributor

    Can you confirm which mechanism you are using to cancel the job?

  2. allancalix commented on Aug 7, 2024

    @allancalix
    Author

    I used the button in the UI in RiverUI, I'm assuming that calls JobCancel but I haven't checked. I did receive the event in the channel but got a nil pointer exception.

  3. bgentry commented on Aug 7, 2024

    @bgentry
    Contributor

    Thanks! This must be a scenario where the job is running on a remote node and gets cancelled, but for some reason doesn’t emit the fully updated job state.

  4. allancalix commented on Aug 10, 2024

    @allancalix
    Author

    I made a small program to replicate this issue but got a seemingly different issue, despite successfully canceling jobs I never get any events on my listener.

    https://github.com/riverqueue/river/compare/master...allancalix:river:bug-cancel-sub-events?expand=1

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions