Skip to content

chore: Use shared mode ApifyStorageClient for test_concurrent_processing_simulation#662

Merged
Pijukatel merged 3 commits intoapify:masterfrom
Mantisus:shared-multi-test
Nov 19, 2025
Merged

chore: Use shared mode ApifyStorageClient for test_concurrent_processing_simulation#662
Pijukatel merged 3 commits intoapify:masterfrom
Mantisus:shared-multi-test

Conversation

@Mantisus
Copy link
Copy Markdown
Collaborator

@Mantisus Mantisus commented Nov 4, 2025

Use ApifyStorageClient(request_queue_access='shared') for test_concurrent_processing_simulation. This is the expected usage for concurrent access. And fix the error in the test

Issues

Closes: #529

@Mantisus Mantisus requested a review from Pijukatel November 4, 2025 15:47
@Mantisus Mantisus self-assigned this Nov 4, 2025
Copy link
Copy Markdown
Contributor

@Pijukatel Pijukatel left a comment

Choose a reason for hiding this comment

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

I have a feeling that this test was flaky for the shared client even before the single client was introduced. Could you stress test it a little locally since the CI is now not running integration tests on fork PRs?

@Mantisus
Copy link
Copy Markdown
Collaborator Author

Mantisus commented Nov 6, 2025

Could you stress test it a little locally since the CI is now not running integration tests on fork PRs?

Out of about 70 runs, this test failed once due to an actor timeout (execution time exceeding 10 minutes).

But there really is a problem. Normally, it takes less than 10 seconds to execute, but in some runs, it takes up to 5 minutes.

UPD: I will try to find the reasons for this.

@Pijukatel Pijukatel self-requested a review November 6, 2025 12:00
@Mantisus Mantisus marked this pull request as draft November 6, 2025 12:04
@Mantisus Mantisus marked this pull request as ready for review November 17, 2025 19:18
@Mantisus Mantisus requested review from Pijukatel and removed request for Pijukatel November 17, 2025 19:19
@Pijukatel
Copy link
Copy Markdown
Contributor

Could you stress test it a little locally since the CI is now not running integration tests on fork PRs?

Out of about 70 runs, this test failed once due to an actor timeout (execution time exceeding 10 minutes).

But there really is a problem. Normally, it takes less than 10 seconds to execute, but in some runs, it takes up to 5 minutes.

UPD: I will try to find the reasons for this.

Have you been able to figure this out?

@Mantisus
Copy link
Copy Markdown
Collaborator Author

Have you been able to figure this out?

The # Randomly reclaim some requests branch caused the worker to execute reclaim_request and immediately fetch_next_request, looping in this state. This was quite random, as it only reproduced if the worker took on 8 requests (a total of 20 requests for 3 workers).
The worker would only exit this state if, at some point in time, another worker managed to take on this request.

@Pijukatel Pijukatel merged commit 85a1bac into apify:master Nov 19, 2025
38 of 39 checks passed
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.

Improve Apify RQ storage client resilience to concurrent processing

3 participants