Skip to content

Keep database connection alive in job runner wait loop #246

Closed

Description

@sbidoul

The main loop of the job runner waits for NOTIFY events via a select() call, with a 60 seconds timeout.

If there are no activity in the queue_job table it seems that tcp keepalives are not sent (in that very specific scenario), causing some intermediaries (such as haproxy) to close the connection, making the jobrunner to restart on a socket error, in turn triggering #245.

A solution (to be tested) is to insert a conn.execute("SELECT 1") around here.

Activity

  1. transferred this issue fromOCA/connectoron Jul 23, 2020
  2. added a commit that references this issue on Jul 24, 2020
    9db745f
  3. houzefa-abba commented on Aug 7, 2020

    @houzefa-abba
    Member

    Another take on this we didn't get around to submit here as the solution is Linux-specific and not optional: xcgd#1

  4. added a commit that references this issue on Sep 30, 2020
    cc8edee
  5. added a commit that references this issue on Oct 16, 2020
    1de18e4
  6. added a commit that references this issue on Oct 25, 2021
    a92c0cd
  7. added 2 commits that reference this issue on Nov 23, 2023
    0f7e52b
    e70b9db
  8. added a commit that references this issue on Nov 25, 2023
    d5d02ba
  9. added 2 commits that reference this issue on Sep 19, 2024
    06224c2
    dacf8f2
  10. added a commit that references this issue on Oct 7, 2024
    26ebe17
  11. added a commit that references this issue on Dec 11, 2025
    25d56b4
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions