Skip to content
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

Create new stanza encoding instance for each thread #72

Merged

Conversation

jefchien
Copy link

@jefchien jefchien commented Aug 7, 2023

Description: The shared buffer in the stanza decoder was causing a concurrency issue where the buffer would get updated by multiple separate threads. This meant that some messages were getting corrupted after decoding and some messages were getting completely replaced. This resulted in duplicates and invalid logs getting passed through the collector.

Link to tracking Issue: open-telemetry#24980

Testing: Reproduced the issue with a generator that established multiple TCP connections and sent to the tcplogreceiver concurrently. No longer seeing the issue after changing the helper.Encoding instantiation to each thread instead of using a shared one.

adam-mateen
adam-mateen previously approved these changes Aug 7, 2023
@jefchien jefchien force-pushed the remove-shared-buffer branch from c393fa9 to d06bc0d Compare August 7, 2023 17:52
@jefchien jefchien changed the title Remove shared buffer in stanza decoder. Create new stanza decoder instance for each thread. Aug 7, 2023
@jefchien
Copy link
Author

jefchien commented Aug 7, 2023

Vulnerability checks and integration test failures are unrelated to change.

@jefchien jefchien changed the title Create new stanza decoder instance for each thread. Create new stanza encoding instance for each thread. Aug 7, 2023
@jefchien jefchien changed the title Create new stanza encoding instance for each thread. Create new stanza encoding instance for each thread Aug 7, 2023
@jefchien jefchien merged commit b8f0f42 into amazon-contributing:aws-cwa-dev Aug 7, 2023
sky333999 pushed a commit that referenced this pull request Aug 10, 2023
@jefchien jefchien deleted the remove-shared-buffer branch September 12, 2023 22:31
lisguo pushed a commit to lisguo/opentelemetry-collector-contrib that referenced this pull request Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants