Skip to content

Keep a queued response when it runs before the request row - #24

Open
JonPurvis wants to merge 1 commit into
saloonphp:mainfrom
JonPurvis:fix/queued-response-waits-for-its-request-row
Open

JonPurvis wants to merge 1 commit into
saloonphp:mainfrom
JonPurvis:fix/queued-response-waits-for-its-request-row

Conversation

@JonPurvis

Copy link
Copy Markdown

Barstool queues the request and the response as two separate jobs. This means that if the response job runs first, it cannot find the request row, so it releases itself for 2 seconds.

Laravel counts that release as an attempt, and the job only has 3 tries. On the fourth pickup the worker fails the job before handle() runs. The request row can still be written later, with no status, body, or duration. A fatal recording uses the same path.

A response or fatal job now gets a 10 minute retryUntil() deadline, which Laravel honours ahead of the 3 try limit. While the request row is missing, the job waits using the configured backoff (5 seconds, then 30) instead of releasing every 2 seconds. Request jobs still stop after 3 tries.

@Sammyjo20 Sammyjo20 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants