-
Notifications
You must be signed in to change notification settings - Fork 28
fix: npm follower occasionally drops incoming updates #1831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Example logs of local setup with |
| // The slowest batch processing time so far (starts at 60 seconds). This is how much time should | ||
| // be left before timeout if a new batch is to be fetched. | ||
| let maxBatchProcessingTime = 30_000; | ||
| let maxBatchProcessingTime = 60_000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NPM follower function does some basic math for when to grab the next batch and when to exit and wait for a subsequent lambda execution. Because this change increases the batch time by up to 30 seconds, I have increased the expected worst-case-scenario time by 30 seconds as well.
The npm follower grabs information from multiple sources that can be out of sync. This subsequently causes some new package updates to not be identified and sent to ingestion.
Basically, with the new NPM API, our NPM follower ingests information from multiple sources. Occasionally there is a delay between picking up a new change from the NPM changes stream and the change actually showing up in the specific package metadata.
Previously, we would just drop this change altogether as unactionable. Subsequent updates to the package could trigger another metadata lookup that would grab the change, but this results in an indeterminate delay.
Now, we identify that the metadata is out of sync by comparing the sequential part of the
revproperty. If the metadatarevis below the changesrev, we know it is lagging behind and exponentially retry until the metadata is updated or until 30 seconds (where we then proceed with the out of sync data).The NPM follower function does some basic math for when to grab the next batch and when to exit and wait for a subsequent lambda execution. Because this change increases the batch time by up to 30 seconds, I have increased the expected worst-case-scenario time by 30 seconds as well.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license