-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tcplogreceiver corrupts messages during decoding. #24980
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This looks like the offending commit - #16027 |
Thanks for reporting this @adam-mateen. Would you be willing to contribute your fix? |
@djaglowski I can do it. Please assign the issue to me. |
Thanks @jefchien! |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
@djaglowski The PR above should've fixed this particular issue. Have there been other reports of message corruption since then? |
Thanks @jefchien. I saw the "time out" and didn't scroll up enough to recall that there was already a PR. I agree this solved unless further reports come in. |
Component(s)
receiver/tcplog
What happened?
Description
Customer has multiple processes (clients) connecting via TCP to our agent.
They noticed the final "Log Events" were corrupted (i.e. random extra characters and/or replaced characters)
The root cause is this line of code:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/stanza/operator/input/tcp/tcp.go#L292
There are separate goroutines for each accepted TCP connection.
And each one can call this in parallel.
However, the
Encoding
struct uses a single shared buffer:https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/stanza/operator/helper/encoding.go#L30-L52
This is not the case in the open source version of Stanza.
Latest Stanza created a new buffer in each call to
Decode()
:https://github.com/observIQ/stanza/blob/main/operator/helper/encoding.go#L44-L62
So I recommend sync with latest Stanza.
Steps to Reproduce
Expected Result
Actual Result
Collector version
0.77.0
Environment information
Environment
OS: AL2
Compiler(if manually compiled): go 1.20
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: