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

fix(inputs.cloud_pubsub): Properly lock for decompression #13525

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

srebhan
Copy link
Contributor

@srebhan srebhan commented Jun 30, 2023

resolves #13513

During #13094 the decompression code was reworked and with it the locking of the decompressor changed slightly. As a consequence the mutex is unlocked just before copying the decompressed data out of the internal buffer leaving a small window where the next decompression could overwrite the internal buffer content partially or as a whole.

The present PR holds the lock until after copying thus avoiding the previous race condition.

@telegraf-tiger telegraf-tiger bot added fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Jun 30, 2023
@telegraf-tiger
Copy link
Contributor

@dayvar14
Copy link
Contributor

Tested in same scenario in #13513 and no longer seems to suffer from the same issue at high volume.

@powersj
Copy link
Contributor

powersj commented Jun 30, 2023

@dayvar14 thank you very much for your help narrowing down where the issue was and of course for confirming the fix. Both helped greatly!

@powersj powersj merged commit 590e4e5 into influxdata:master Jun 30, 2023
24 checks passed
@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jun 30, 2023
powersj pushed a commit to powersj/telegraf that referenced this pull request Jul 5, 2023
powersj pushed a commit that referenced this pull request Jul 10, 2023
@srebhan srebhan added this to the v1.27.2 milestone Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Cloud Pubsub: Batching with gzip encoding/decoding failing at high volumes
3 participants