Merge pull request #3913 from nats-io/jarema/fix-sourcing-memory-bloat

Fix memory bloat when adding source to the stream
This commit is contained in:
Derek Collison
2023-02-27 07:03:06 -08:00
committed by GitHub

View File

@@ -2850,10 +2850,8 @@ func (mset *stream) processInboundSourceMsg(si *sourceInfo, m *inMsg) bool {
// Generate a new style source header.
func (si *sourceInfo) genSourceHeader(reply string) string {
var b strings.Builder
// strip the source index number from the iname
name := si.iname[strings.IndexRune(si.iname, ':')+1:]
b.WriteString(name)
b.WriteString(si.iname)
b.WriteByte(' ')
// Grab sequence as text here from reply subject.
var tsa [expectedNumReplyTokens]string