-
Notifications
You must be signed in to change notification settings - Fork 648
Open
Description
Core Issue:
The log.warn() call passes event both as a positional argument (first parameter "publish failed") and a keyword argument (event=e.event), violating the function signature and throwing an exception.
Consequences:
- Uncaught exception → Blocks cleanup task
_complete_prediction - Service state stuck → Subsequent requests fail with
{"detail": "Already running a prediction"}
Solution:
Rename the keyword argument event to a non-conflicting name (e.g., event_data) to avoid clashing with the positional event parameter:
log.warn(
"publish failed", # Positional argument → event message
subscriber=subscriber,
tag=e.tag,
event_data=e.event, # Renamed keyword argument (prev: event=e.event)
exc_info=True,
)Key Fixes:
- Parameter Renaming:
- Change
event=e.event→event_data=e.event(or any non-reserved name)
- Change
- Function Signature Compliance:
- First positional argument (
"publish failed") is automatically mapped toevent - All other data passed via keywords without conflict
- First positional argument (
Impact:
- Prevents the duplicate
eventexception - Ensures
_complete_predictionexecutes → Releases service state lock - Restores normal
/predictionsfunctionality
Metadata
Metadata
Assignees
Labels
No labels