Skip to content

Commit

Permalink
Add broker_max_dismissed_requests configuration and update dispatcher…
Browse files Browse the repository at this point in the history
… limit
  • Loading branch information
francesconazzaro committed Jan 17, 2025
1 parent b29b22d commit bb47ae5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions cads_broker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class BrokerConfig(pydantic_settings.BaseSettings):
broker_requeue_limit: int = 3
broker_max_internal_scheduler_tasks: int = 500
broker_max_accepted_requests: int = 2000
broker_max_dismissed_requests: int = 100
broker_cancel_stuck_requests_cache_ttl: int = 60
broker_stuck_requests_limit_minutes: int = 15

Expand Down
2 changes: 1 addition & 1 deletion cads_broker/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def sync_database(self, session: sa.orm.Session) -> None:
# the retrieve API sets the status to "dismissed",
# here the broker fixes the QoS and queue status accordingly
dismissed_requests = db.get_dismissed_requests(
session, limit=CONFIG.broker_max_accepted_requests
session, limit=CONFIG.broker_max_dismissed_requests
)
for request in dismissed_requests:
if future := self.futures.pop(request.request_uid, None):
Expand Down

0 comments on commit bb47ae5

Please sign in to comment.