Skip to content

Commit

Permalink
add panic handler to async client/channel writes
Browse files Browse the repository at this point in the history
See #2113 for motivation
  • Loading branch information
slingamn committed Jan 5, 2024
1 parent 1d8bbde commit dfe2a21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions irc/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ func (channel *Channel) wakeWriter() {

// equivalent of Socket.send()
func (channel *Channel) writeLoop() {
defer channel.server.HandlePanic()

for {
// TODO(#357) check the error value of this and implement timed backoff
channel.performWrite(0)
Expand Down
2 changes: 2 additions & 0 deletions irc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1773,6 +1773,8 @@ func (client *Client) wakeWriter() {
}

func (client *Client) writeLoop() {
defer client.server.HandlePanic()

for {
client.performWrite(0)
client.writebackLock.Unlock()
Expand Down

0 comments on commit dfe2a21

Please sign in to comment.