fix: Use same client_key for Actor created request_queue and improve its metadata estimation#552
Merged
fix: Use same client_key for Actor created request_queue and improve its metadata estimation#552
client_key for Actor created request_queue and improve its metadata estimation#552Conversation
Seems to be some problem on the platform?
Platform acknowledged it is a bug
Contributor
Author
|
As of now, the In develop branch: https://github.com/apify/apify-worker/pull/1470 |
vdusek
requested changes
Aug 20, 2025
Update leftover id-based variable names
vdusek
reviewed
Aug 21, 2025
Contributor
Author
|
The necessary fix on the platform was merged to master, and it is working now. |
vdusek
approved these changes
Aug 22, 2025
Contributor
vdusek
left a comment
There was a problem hiding this comment.
Looks good, let's see how it behaves...
I'm just not sure about the feat: 🙂, maybe rather a fix?
client_key for Actor created request_queue and improve its metadata estimationclient_key for Actor created request_queue and improve its metadata estimation
d385e5d to
d33f4b4
Compare
Pijukatel
added a commit
that referenced
this pull request
Aug 27, 2025
wait for #552 to be merged first
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
RequestQueuefrom Actor on the platform or withforce_cloud=Truetheclient_keyshould be set torun_id. This ensures:RequestQueueinstance that is usingApifyRequestQueueClientwill be done with the sameclient_keyand thus in metadatahad_multiple_clients=FalseActor.open_request_queue()on the platform share the sameclient_keyand thus in metadatahad_multiple_clients=Falseclient_keyis set torun_id, it remains the same for resurrected or migrated run, and thus in metadatahad_multiple_clients=Falsehad_multiple_clientsallows better estimation ofRequestQueuemetadata.had_multiple_clients=False, it is possible to trust local estimation of the metadata.had_multiple_clients=True, local estimation is no longer valid, but still can, in some cases, improve estimation by being ahead of the delayed API update of the metadata. Therefore API-based metadata are fused with local metadata estimation to produce as good estimation as we can.ApifyRequestQueueClientinit changed to properly initialize from full metadata - to enable more reliable metadata after migration/resurrection or when using existingRequestQueue_list_head, if there is a call to API, use the availablehad_multiple_clientsto update local estimation of this value. This is a cheap way of knowing if there is another client or not without the need to make a new API call._list_headis called frequently enough to make the local estimation ofhad_multiple_clientsdecently good.Issues
client_keyfor all ApifyRequestQueue client calls #536Testing