Skip to content

Restore global Delayed::Worker settings in worker spec - #5672

Draft
philippthun wants to merge 1 commit into
cloudfoundry:mainfrom
sap-contributions:fix-delayed-worker-read-ahead-leak
Draft

philippthun wants to merge 1 commit into
cloudfoundry:mainfrom
sap-contributions:fix-delayed-worker-read-ahead-leak

Conversation

@philippthun

Copy link
Copy Markdown
Member

start_working mutates class-level Delayed::Worker attributes (read_ahead, max_run_time, etc.) that persist across examples. A leaked read_ahead of 0 pushes unrelated specs onto the lock_with_for_update path, which keeps a full-precision in-memory locked_at and makes the delayed_jobs_metrics pickup-delay test flaky on MySQL. Snapshot these settings before each example and restore them after.

Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:

  • A short explanation of the proposed change:

  • An explanation of the use cases your change solves

  • Links to any other associated PRs

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

start_working mutates class-level Delayed::Worker attributes
(read_ahead, max_run_time, etc.) that persist across examples. A
leaked read_ahead of 0 pushes unrelated specs onto the
lock_with_for_update path, which keeps a full-precision in-memory
locked_at and makes the delayed_jobs_metrics pickup-delay test flaky
on MySQL. Snapshot these settings before each example and restore
them after.

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.

1 participant