Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
cathyzbn committed Aug 30, 2024
1 parent 67bafd1 commit b48a0d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modal/_container_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def worker_thread():
logger.exception(f"Exception raised by {_func} in DaemonizedThreadPool worker!")
self.inputs.task_done()

if self.spawned_workers < self.container_io_manager.get_input_concurrency():
if self.spawned_workers < self.max_threads:
threading.Thread(target=worker_thread, daemon=True).start()
self.spawned_workers += 1

Expand Down
1 change: 1 addition & 0 deletions modal/_container_io_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ async def _dynamic_concurrency_loop(self):

except Exception as exc:
logger.debug(f"Failed to get dynamic concurrency for task {self.task_id}, {exc}")

await asyncio.sleep(DYNAMIC_CONCURRENCY_INTERVAL_SECS)

async def get_app_objects(self) -> RunningApp:
Expand Down
4 changes: 2 additions & 2 deletions modal/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def function(
allow_concurrent_inputs: Optional[int] = None, # Maximum number of inputs the container may fetch concurrently.
target_concurrent_inputs: Optional[
int
] = None, # .# Desired input concurrency for autoscaling. Must be <= allow_concurrent_inputs.
] = None, # Desired input concurrency for autoscaling. Must be <= allow_concurrent_inputs.
container_idle_timeout: Optional[int] = None, # Timeout for idle containers waiting for inputs to shut down.
timeout: Optional[int] = None, # Maximum execution time of the function in seconds.
keep_warm: Optional[
Expand Down Expand Up @@ -763,7 +763,7 @@ def cls(
allow_concurrent_inputs: Optional[int] = None, # Maximum number of inputs the container may fetch concurrently.
target_concurrent_inputs: Optional[
int
] = None, # .# Desired input concurrency for autoscaling. Must be <= allow_concurrent_inputs.
] = None, # Desired input concurrency for autoscaling. Must be <= allow_concurrent_inputs.
container_idle_timeout: Optional[int] = None, # Timeout for idle containers waiting for inputs to shut down.
timeout: Optional[int] = None, # Maximum execution time of the function in seconds.
keep_warm: Optional[int] = None, # An optional number of containers to always keep warm.
Expand Down

0 comments on commit b48a0d0

Please sign in to comment.