mirror of
https://github.com/run-llama/llama_deploy.git
synced 2026-07-15 05:08:22 -04:00
[PR #472] [MERGED] fix: race condition in deployment_state metric updates
#486
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/run-llama/llama_deploy/pull/472
Author: @masci
Created: 2/24/2025
Status: ✅ Merged
Merged: 2/26/2025
Merged by: @masci
Base:
main← Head:massi/fix-deployment-status📝 Commits (1)
cb1f484fix: deployment_state metric not updated in containers📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
llama_deploy/apiserver/deployment.py(+1 -1)📄 Description
Due to the asynchronous nature of the
start()method, the metricdeployment_staterunning state could be overwritten withstarting_servicesat a later time. This was very consistent in containers, where low resources highlighted the problem causing the metric to report an incorrect value.Note that technically a better fix would have been adding a mutex to make sure the state is always 100% accurate, but I preferred to go with this fix because metric fidelity is good enough and the code is much simpler and easy to read.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.