You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 3, 2025. It is now read-only.
As I understand it, the only place where the unit status can transition to AssignmentState.COMPLETED is in mephisto/data_model/unit.py in get_status(). This method needs to be called to keep the agent status and unit status in sync. However, when checking if a worker can work on another assignment, this is probably not called. Normally this is not an issue because the operator regularly (indirectly) calls this here:
asyncdef_track_and_kill_runs(self):
...
ifnottracked_run.force_shutdown:
iftracked_run.task_launcher.finished_generatorsisFalse:
# If the run can still generate assignments, it's# definitely not donecontinuetask_run=tracked_run.task_runtask_run.update_completion_progress(
task_launcher=tracked_run.task_launcher
)
ifnottask_run.get_is_completed(): # <- herecontinue
...
However, when the using a long-running generator, it can happen that a unit finishes before the generator does.
If you want to try this, on this branch I replaced the static_task_data with the following generator:
defslow_generator():
importtimei=0while(True):
i+=1time.sleep(3)
yield {"text": f"This is assignment {i}"}
One quick fix would be to simply move the emptiness check of the generator below get_is_completed see #1039. But a cleaner solution would probably be to either
always sync the states when accessing the assignment status (i.e. also when checking if workers can take on more units) or
As I understand it, the only place where the unit status can transition to
AssignmentState.COMPLETEDis inmephisto/data_model/unit.pyinget_status(). This method needs to be called to keep the agent status and unit status in sync. However, when checking if a worker can work on another assignment, this is probably not called. Normally this is not an issue because the operator regularly (indirectly) calls this here:However, when the using a long-running generator, it can happen that a unit finishes before the generator does.
If you want to try this, on this branch I replaced the
static_task_datawith the following generator:One quick fix would be to simply move the emptiness check of the generator below
get_is_completedsee #1039. But a cleaner solution would probably be to eitherEDIT: this only happens for screening units!