-
Notifications
You must be signed in to change notification settings - Fork 512
Fix clock handling for API submissions #2770
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @CaptWake, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical issue in how CAPEv2 handles clock synchronization for API-submitted tasks. By adjusting the default clock value to the Unix epoch when not specified, it ensures that the analysis manager can properly set the task's clock, preventing failures in network requests that arise from significant time differences between submission and execution. This enhancement improves the reliability and robustness of analyses, especially in environments with potential processing delays. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request aims to fix an issue with clock handling for API submissions by setting the clock to epoch when it's not specified. The change correctly handles an empty clock parameter but misses the case where the parameter is not provided at all, which would still default to the submission time. I've suggested a simplification that addresses both scenarios and makes the code's intent clearer.
|
Thanks very much. I am certainly intrigued by what scale might see days of delay! |
I’ve experienced this when submitting around 20k PE samples, with the timeout set to 3 minutes and using 10 VMs. I was submitting the samples through the API using a simple sequential submission script, and some tasks started to run several days later after the submission |
When submitting a sample through the API without specifying the clock, the
parse_request_arguments()function automatically sets the clock to the submission time. Later, the analysis manager tries to update the clock before running the task. However, the clock update only works correctly if the timestamp is set to 0 (database.py)This behavior can cause problems in large-scale analyses, where there can be a significant delay (even days) between submission and execution. In such cases, if the sample makes network requests, they can fail due to the large discrepancy between the submission time and the actual task execution time.
Setting the clock to 0 instead of the submission time ensures that the clock update in the analysis manager works correctly, preventing this issue