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

Database errors on startup stops queue worker #416

Open
divergentdave opened this issue Aug 17, 2023 · 2 comments
Open

Database errors on startup stops queue worker #416

divergentdave opened this issue Aug 17, 2023 · 2 comments

Comments

@divergentdave
Copy link
Collaborator

I brought divviup-api up before the database schema was ready, and the following panic happened in the queue worker task.

thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Query(SqlxError(Database(PgDatabaseError { severity: Error, code: "42P01", message: "relation \"queue\" does not exist", detail: None, hint: None, position: Some(Original(253)), where: None, schema: None, table: None, column: None, data_type: None, constraint: None, file: Some("parse_relation.c"), line: Some(1384), routine: Some("parserOpenTable") })))', src/queue.rs:195:57

This was likely from the schedule_recurring_tasks_if_needed() call. The process continued to run, but asynchronous tasks did not make any progress.

@jbr
Copy link
Contributor

jbr commented Aug 18, 2023

What should we do? Probably exit with an error?

@divergentdave
Copy link
Collaborator Author

I think exiting with an error would be good in the case of schedule_recurring_tasks_if_needed(), since that only has to happen once at startup IIUC. The worker task should otherwise keep running if it gets errors during steady-state operation, but I think we're okay on that front from a quick skim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants