Skip to content

Cron: Log and capture timeout errors in cron job execution #333

Closed

Description

@ankit-0903

Description

While checking packages/modelence/src/cron/jobs.ts, I noticed that when a cron job runs past its configured timeout, the state is reset back to false but no error is logged or reported. There is also a TODO comment left in the code regarding this.

Because of this, when a cron job times out in production, it fails silently without emitting any telemetry or logs.

Expected Behavior

When a cron job times out, it should log and capture the timeout error so we can track stuck or failing jobs in telemetry.

Proposed Solution

Create an error instance when a job times out and pass it to captureError from @/telemetry before resetting the job state.

Activity

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