Skip to content

Test postgresql connection/table on startup #52

Closed

Description

@TheBlueMatt

It would be really nice if the daemon tested that it can connect to the postgresql db and has the right database schema set up on startup so that you don't just get the errors later at runtime.

Activity

  1. TheBlueMatt commented on Aug 11, 2025

    @TheBlueMatt
    ContributorAuthor

    Usually this kind of application will also create and tables it needs in the database, if they're missing, so we should do that too.

  2. G8XSU commented on Aug 11, 2025

    @G8XSU
    Contributor

    It is intentional to not check db connection on startup to avoid cascading failures in distributed service deployments.
    In case, this service is unable to communicate with DB over network, you don't want this service to go down or start failing deployments for vss.

    Let's assume one more service was dependent on vss, should it fail to startup/deploy because it can't communicate with vss? I don't think so.

    create and tables it needs in the database

    This kind of approach makes sense in local only setups but for production usually infrastructure setup like spinning up a db cluster or table setup is separated out from service itself, and has stricter guardrails.

  3. TheBlueMatt commented on Aug 12, 2025

    @TheBlueMatt
    ContributorAuthor

    Huh? I've never seen a service that requires DB access happily start running if it can't connect to the DB. I agree that shutting down due to DB connection failures can start cascading failures, but starting up is pretty different - if you were previously down the failure already happened, failing to start doesn't worsen it. Not failing to start, on the other hand, can lead to worse outcomes - if you have a distributed deployment with a bunch of VSS instances and you misconfigure the DB connection string you'll end up with half of them broken and the other half working and trying to service requests from all of them, especially since we have no way to figure out if an instance is even working - #29

  4. self-assigned this
    on Aug 14, 2025
  5. tankyleo commented on Jun 3, 2026

    @tankyleo
    Contributor

    Fixed in #55

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

Metadata

Metadata

Assignees

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