-
Notifications
You must be signed in to change notification settings - Fork 881
Bug: Agent script timings are returning more than one script timing for script #16124
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
Comments
Another strange observation is that the agent connection time and provisioner timings are from 2024-12-18, which seems to be an unusually old date. 🤔 This makes me wonder if there might be a date-related issue in the codebase. This might be a different bug. |
To summarize a call I had with @mafredri We believe that the behavior witnessed with one script having multiple script timings is expected in the instance that an agent crashes and restarts. In this instance the agent will re-run the startup scripts, resulting in a second set of script runs ending up in the database. We discussed a couple of options:
We've decided that the final option makes the most sense for now, as it requires the least changes. |
Sounds like a reasonable approach 👍 I think option 2 is worth doing later on, though. |
Expanding on 2, we can infer a pseudo-run ID via |
This might be useful soon for prebuilds, since we'll have the agent reinitialize after being claimed by a user: https://www.notion.so/coderhq/Prebuilds-176d579be59280398851fe6473badfe7?pvs=4#17cd579be592805db784d9bc8fc54a0e |
#16203) (#16208) Co-authored-by: Danielle Maywood <[email protected]> Fixes #16124
I believe an agent script timing should only be reported once per build since the script only runs once per build. Considering this, the response from the
/api/v2/workspacebuilds/build-id/timings
endpoint becomes confusing when it returns multiple agent script timings for the same script in the same build.For instance, here's an example of the response:
Response
Multiple timings for the "Startup Script" are reported, spanning different dates within the same build, which doesn’t align with expected behavior.
Possible Causes:
Additional Context:
The text was updated successfully, but these errors were encountered: