Skip to content

Wrap events and IRC messages to clients watchdog and log#677

Draft
hloeung wants to merge 7 commits into
42wim:masterfrom
hloeung:blocking-channel
Draft

Wrap events and IRC messages to clients watchdog and log#677
hloeung wants to merge 7 commits into
42wim:masterfrom
hloeung:blocking-channel

Conversation

@hloeung

@hloeung hloeung commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

This is for handling of events and sending IRC messages to clients connect to matterircd.

#674 is for receiving of Mattermost events via the WebSocket and processing by matterircd.

@hloeung hloeung marked this pull request as draft July 10, 2026 09:20
@hloeung hloeung force-pushed the blocking-channel branch from 8240c53 to 9d4041e Compare July 10, 2026 10:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent worker deadlocks caused by blocking channel sends in the IRC decode pipeline and Mattermost websocket event handling, and also addresses ticker lifecycle cleanup.

Changes:

  • Ensure long-lived tickers are stopped via defer ...Stop() to avoid ticker leaks.
  • Update IRC decode buffering to use a bounded buffer and guarded sends to reduce blocking.
  • Introduce safeEventSend for Mattermost event dispatch and route several websocket event paths through it.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
mm-go-irckit/userbridge.go Stops the per-call throttle ticker to avoid leaking ticker resources.
mm-go-irckit/user.go Adds a bounded paste buffer and a timeout-guarded send path to avoid blocking on DecodeCh.
bridge/mattermost/mattermost.go Stops the channel-update ticker; introduces safeEventSend and uses it in several event dispatch points.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mm-go-irckit/user.go
Comment thread mm-go-irckit/user.go Outdated
Comment thread mm-go-irckit/user.go Outdated
Comment thread bridge/mattermost/mattermost.go
Comment thread bridge/mattermost/mattermost.go
@hloeung hloeung force-pushed the blocking-channel branch from e7dbb7c to 80ea241 Compare July 10, 2026 12:54
@hloeung hloeung changed the title Fix blocking channel send deadlock Wrap events and IRC messages to clients watchdog and log Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants