Browse Source

add panic handler to async client/channel writes

See #2113 for motivation
tags/v2.13.0-rc1
Shivaram Lingamneni 4 months ago
parent
commit
dfe2a21b17
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
 
222
 
223
 // equivalent of Socket.send()
223
 // equivalent of Socket.send()
224
 func (channel *Channel) writeLoop() {
224
 func (channel *Channel) writeLoop() {
225
+	defer channel.server.HandlePanic()
226
+
225
 	for {
227
 	for {
226
 		// TODO(#357) check the error value of this and implement timed backoff
228
 		// TODO(#357) check the error value of this and implement timed backoff
227
 		channel.performWrite(0)
229
 		channel.performWrite(0)

+ 2
- 0
irc/client.go View File

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

Loading…
Cancel
Save