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: move bufio reader creation out of for loop to fix telemetry unmarshal errors #2789

Merged
merged 5 commits into from
Jun 22, 2024

Conversation

QxBytes
Copy link
Contributor

@QxBytes QxBytes commented Jun 14, 2024

If the bufio reader is created in the for loop that handles reads we get unmarshaling errors. Creating a single bufio reader outside of the for loop once the connection is accepted and then repeatedly looping over that single reader fixes this issue.

Reason for Change:

See above

Issue Fixed:

Requirements:

Notes:

if the bufio reader is created in the for loop we get unmarshaling errors
@QxBytes QxBytes requested a review from a team as a code owner June 14, 2024 23:14
@QxBytes QxBytes requested a review from csfmomo June 14, 2024 23:14
@QxBytes QxBytes added cni Related to CNI. fix Fixes something. telemetry labels Jun 14, 2024
QxBytes added 3 commits June 14, 2024 16:23
a previous fix ensured the socket closed on error, but this caused an existing ut to nondeterministically fail
without the previous fix, the socket wouldn't have been closed on error
telemetry/telemetrybuffer.go Outdated Show resolved Hide resolved
@QxBytes QxBytes enabled auto-merge June 20, 2024 17:13
@QxBytes QxBytes added this pull request to the merge queue Jun 21, 2024
Merged via the queue into master with commit ff0c3ea Jun 22, 2024
89 checks passed
@QxBytes QxBytes deleted the alew/fix-unmarshal branch June 22, 2024 01:16
QxBytes added a commit that referenced this pull request Jun 25, 2024
…rshal errors (#2789)

* move bufio reader creation out of for loop

if the bufio reader is created in the for loop we get unmarshaling errors

* fix linter issue

* add fixed ut

* fix existing unit test flake due to closing pipe on error

a previous fix ensured the socket closed on error, but this caused an existing ut to nondeterministically fail
without the previous fix, the socket wouldn't have been closed on error

* make read inline
QxBytes added a commit that referenced this pull request Jun 25, 2024
…rshal errors (#2789)

* move bufio reader creation out of for loop

if the bufio reader is created in the for loop we get unmarshaling errors

* fix linter issue

* add fixed ut

* fix existing unit test flake due to closing pipe on error

a previous fix ensured the socket closed on error, but this caused an existing ut to nondeterministically fail
without the previous fix, the socket wouldn't have been closed on error

* make read inline
QxBytes added a commit that referenced this pull request Jun 25, 2024
…rshal errors (#2789)

* move bufio reader creation out of for loop

if the bufio reader is created in the for loop we get unmarshaling errors

* fix linter issue

* add fixed ut

* fix existing unit test flake due to closing pipe on error

a previous fix ensured the socket closed on error, but this caused an existing ut to nondeterministically fail
without the previous fix, the socket wouldn't have been closed on error

* make read inline
QxBytes added a commit that referenced this pull request Jun 25, 2024
…metry unmarshal errors (#2789) (#2813)

fix: move bufio reader creation out of for loop to fix telemetry unmarshal errors (#2789)

* move bufio reader creation out of for loop

if the bufio reader is created in the for loop we get unmarshaling errors

* fix linter issue

* add fixed ut

* fix existing unit test flake due to closing pipe on error

a previous fix ensured the socket closed on error, but this caused an existing ut to nondeterministically fail
without the previous fix, the socket wouldn't have been closed on error

* make read inline
QxBytes added a commit that referenced this pull request Jun 26, 2024
…rshal errors (#2789)

* move bufio reader creation out of for loop

if the bufio reader is created in the for loop we get unmarshaling errors

* fix linter issue

* add fixed ut

* fix existing unit test flake due to closing pipe on error

a previous fix ensured the socket closed on error, but this caused an existing ut to nondeterministically fail
without the previous fix, the socket wouldn't have been closed on error

* make read inline
QxBytes added a commit that referenced this pull request Jun 26, 2024
…metry unmarshal errors (#2789) (#2812)

* fix: move bufio reader creation out of for loop to fix telemetry unmarshal errors (#2789)

* move bufio reader creation out of for loop

if the bufio reader is created in the for loop we get unmarshaling errors

* fix linter issue

* add fixed ut

* fix existing unit test flake due to closing pipe on error

a previous fix ensured the socket closed on error, but this caused an existing ut to nondeterministically fail
without the previous fix, the socket wouldn't have been closed on error

* make read inline

* make ut compatible with 1.4.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cni Related to CNI. fix Fixes something. telemetry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants