Skip to content

Global handler-dispatch bound (reactions/actions/slash/modals) #61

@patrick-chinchill

Description

@patrick-chinchill

Follow-up from #51 / PR #60. ConcurrencyConfig.max_concurrent is now enforced for the concurrent strategy in process_message, but other dispatch paths each spawn tasks independently:

  • process_reaction_dispatch_to_handlers(self._reaction_handlers, ...)
  • process_action
  • process_slash_command
  • process_modal_submit / process_modal_close

A burst of webhook traffic across event types can still exceed a single resource budget even with max_concurrent=N set. Options:

  1. Promote _concurrent_semaphore to a shared bound across every dispatch path (not just message). Simple; breaks the current per-path isolation.
  2. Add separate ConcurrencyConfig.max_concurrent_by_event_type knobs.
  3. Expose the semaphore on the Chat so consumers can wrap custom handlers themselves.

No upstream parity signal — TS doesn't enforce max_concurrent at all. Revisit only if a real consumer hits unbounded concurrency under cross-event load.

Severity: low (no reported incidents; queue / drop strategies already have other backpressure; most adapters rate-limit at the webhook ingress).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions