Skip to content

Commit 4e0cad0

Browse files
authored
Merge pull request #84 from runpod/fix_scaling
Data Race in TakeJob
2 parents 102592a + a1154f1 commit 4e0cad0

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

runpod/serverless/modules/rp_scale.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,9 @@ async def get_jobs(self, session):
9999
if not self.is_alive():
100100
break
101101

102-
tasks = [
103-
asyncio.create_task(
104-
get_job(session, retry=False)
105-
) for _ in range(self.num_concurrent_get_job_requests)]
106-
107-
for job_future in asyncio.as_completed(tasks):
108-
job = await job_future
102+
for _ in range(self.num_concurrent_get_job_requests):
103+
job = await get_job(session, retry=False)
109104
self.job_history.append(1 if job else 0)
110-
111105
if job:
112106
yield job
113107

0 commit comments

Comments
 (0)