divviup / divviup/divviup-api

Database errors on startup stops queue worker

Open
#416 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
10
Forks
5
Avg merge
2h 41m
Merged PRs (30d)
66

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/queue.rs around line 195 and inspect schedule_recurring_tasks_if_needed(). Reproduce the startup sequence with the database schema unavailable. Done means the queue worker does not panic in this condition and asynchronous tasks make progress once the schema is ready.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, rust
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.