Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
allancalix opened this issue Aug 7, 2024 · 4 comments
Open

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

allancalix opened this issue Aug 7, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@allancalix
Copy link

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

@bgentry
Copy link
Contributor

bgentry commented Aug 7, 2024

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

@allancalix
Copy link
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.

@bgentry
Copy link
Contributor

bgentry commented Aug 7, 2024

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.

@allancalix
Copy link
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

@bgentry bgentry added the bug Something isn't working label Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants