Skip to content

Keep database connection alive in job runner wait loop #246

@sbidoul

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.

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