Skip to content

Commit

Permalink
Add configurable user-visible log message for memory errors
Browse files Browse the repository at this point in the history
  • Loading branch information
francesconazzaro committed Feb 3, 2025
1 parent 755cba3 commit a8cd3d6
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 @@ -42,6 +42,7 @@ class BrokerConfig(pydantic_settings.BaseSettings):
broker_max_dismissed_requests: int = 100
broker_cancel_stuck_requests_cache_ttl: int = 60
broker_stuck_requests_limit_minutes: int = 15
broker_memory_error_user_visible_log: str = "Worker has been killed due to memory usage."


class SqlalchemySettings(pydantic_settings.BaseSettings):
Expand Down
2 changes: 1 addition & 1 deletion cads_broker/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def set_request_error_status(
db.add_event(
event_type="user_visible_error",
request_uid=request_uid,
message="Worker has been killed due to memory usage. ",
message=CONFIG.broker_memory_error_user_visible_log,
session=session,
)
request = db.set_request_status(
Expand Down

0 comments on commit a8cd3d6

Please sign in to comment.