Skip to content

Log Parameter Conflict Causing State Deadlock - Duplicate event Argument Triggers Exception #2517

@RongzByte

Description

@RongzByte

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:

  1. Uncaught exception → Blocks cleanup task _complete_prediction
  2. 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:

  1. Parameter Renaming:
    • Change event=e.eventevent_data=e.event (or any non-reserved name)
  2. Function Signature Compliance:
    • First positional argument ("publish failed") is automatically mapped to event
    • All other data passed via keywords without conflict

Impact:

  • Prevents the duplicate event exception
  • Ensures _complete_prediction executes → Releases service state lock
  • Restores normal /predictions functionality

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions