Browse Source

Merge pull request #2117 from slingamn/handlepanic

add panic handler to async client/channel writes
tags/v2.13.0-rc1
Shivaram Lingamneni 3 months ago
parent
commit
0f059ea2cc
No account linked to committer's email address
2 changed files with 4 additions and 0 deletions
  1. 2
    0
      irc/channel.go
  2. 2
    0
      irc/client.go

+ 2
- 0
irc/channel.go View File

@@ -222,6 +222,8 @@ func (channel *Channel) wakeWriter() {
222 222
 
223 223
 // equivalent of Socket.send()
224 224
 func (channel *Channel) writeLoop() {
225
+	defer channel.server.HandlePanic()
226
+
225 227
 	for {
226 228
 		// TODO(#357) check the error value of this and implement timed backoff
227 229
 		channel.performWrite(0)

+ 2
- 0
irc/client.go View File

@@ -1773,6 +1773,8 @@ func (client *Client) wakeWriter() {
1773 1773
 }
1774 1774
 
1775 1775
 func (client *Client) writeLoop() {
1776
+	defer client.server.HandlePanic()
1777
+
1776 1778
 	for {
1777 1779
 		client.performWrite(0)
1778 1780
 		client.writebackLock.Unlock()

Loading…
Cancel
Save