Skip to content

Commit

Permalink
feat[SOL-107974]: Message dump with large creation+transport traceSta…
Browse files Browse the repository at this point in the history
…te cuts off
  • Loading branch information
oodigie committed Dec 5, 2023
1 parent b7562de commit e45f182
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions internal/ccsmp/ccsmp_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ func SolClientMessageSetTimeToLive(messageP SolClientMessagePt, timeToLive int64

// Utility functions

const defaultMsgDumpBufferSize = 1000
const msgDumpMultiplier = 5
// Set the default message dump buffer size to accommodate
// the Distributed Tracing properties in the message dump, SOL-107974
const maxDumpSize = 10000

// SolClientMessageDump function
Expand Down Expand Up @@ -587,11 +587,9 @@ func SolClientMessageDump(messageP SolClientMessagePt) string {
}
}

bufferSize := C.ulong(defaultMsgDumpBufferSize + payloadSize*msgDumpMultiplier)
// Truncate the message after 10,000 characters, SOL-62945
if bufferSize > maxDumpSize {
bufferSize = maxDumpSize
}
// removed the dynamic calculation of buffer size as defaultMsgDumpBufferSize{1000} + (payloadSize * msgDumpMultiplier{5})
bufferSize := C.ulong(maxDumpSize)
buffer := (*C.char)(C.malloc(bufferSize))
defer C.free(unsafe.Pointer(buffer))

Expand Down

0 comments on commit e45f182

Please sign in to comment.