Skip to content

Clear the task identifier cache when a lookup fails - #640

Open
devtechedge wants to merge 1 commit into
graphile:mainfrom
devtechedge:fix-rejected-task-identifier-cache
Open

devtechedge wants to merge 1 commit into
graphile:mainfrom
devtechedge:fix-rejected-task-identifier-cache

Conversation

@devtechedge

Copy link
Copy Markdown

getTaskDetails stores the in-flight task-identifier lookup before it resolves. If that promise rejects, for example on admin shutdown (57P01) or a dropped connection, every later poll with the same task list gets that same rejection. Jobs added afterwards never run, and the runner promise never settles.

The lookup is cleared when it rejects, as long as a newer lookup has not already replaced it. The next poll tries again.

The new test rejects the lookup once, then checks the following call looks it up again and the one after that still uses the cache. That test failed before the change and passes after.

Fixes #638.

This branch has not been deployed

No deployments
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.

Task identifier cache keeps a rejected lookup forever, wedging the runner after a connection drop

1 participant