Answer dead-letters on the lent serving connection, and keep one clip helper
Two handles to the same serving connection, and two copies of one helper, would drift (review of hq issues 327 and 330).
This commit is contained in:
@@ -143,7 +143,7 @@ func reconnecting(read closedConnections) []conditions.Observation {
|
||||
"client reconnecting in a loop", u.User, u.Dropped, partial, reconnectBound),
|
||||
Said: fmt.Sprintf("%d of %d closed connections dropped in %.0f h; by name %s; why %s", u.Dropped,
|
||||
u.Closed, hours, strings.Join(names, ", "), strings.Join(why, ", ")),
|
||||
Headline: clipWords(conditions.Capital(who)+" keeps losing the bus", 60),
|
||||
Headline: clip(conditions.Capital(who)+" keeps losing the bus", 60),
|
||||
Explanation: conditions.Capital(fmt.Sprintf("%s lost its connection to the bus %d times in the last hour "+
|
||||
"and connected again each time. While it reconnects, what it says and what it is asked waits.", who,
|
||||
u.Dropped)),
|
||||
@@ -171,15 +171,3 @@ func busUserWords(user string) (string, string) {
|
||||
}
|
||||
return "a client of the bus", ""
|
||||
}
|
||||
|
||||
// clipWords is words at most n characters long, cut at a word.
|
||||
func clipWords(s string, n int) string {
|
||||
if len(s) <= n {
|
||||
return s
|
||||
}
|
||||
cut := s[:n]
|
||||
if i := strings.LastIndex(cut, " "); i > 0 {
|
||||
cut = cut[:i]
|
||||
}
|
||||
return cut
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user