-
Notifications
You must be signed in to change notification settings - Fork 180
Open
Description
Hi,
My gy client application goroutines are getting blocked in this mutex.Lock call
And ultimately, running out of memory.
How can I set the WriteTimeout when acting as a Diameter Gy client and performing a WriteToWithRetry call
func (w *response) Write(b []byte) (int, error) {
w.mu.Lock()
defer w.mu.Unlock()
if w.conn.server.WriteTimeout > 0 {
w.conn.rwc.SetWriteDeadline(time.Now().Add(w.conn.server.WriteTimeout))
}
msc, isMulti := w.conn.rwc.(MultistreamConn) // Note - SetWriteDeadline is not currently supported for SCTP
if isMulti { // don't use buffered writer for muti-streamming writes it'll mix up streams
return msc.Write(b)
}
n, err := w.conn.buf.Writer.Write(b)
if err != nil {
return 0, err
}
if err = w.conn.buf.Writer.Flush(); err != nil {
return 0, err
}
return n, nil
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels