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

[pkg/stanza] Windows input operator logs noisy error while collecting successfully #35520

Merged

Conversation

kuiperda
Copy link
Contributor

@kuiperda kuiperda commented Oct 1, 2024

Description:

If Input::read returns 0, the operator will attempt to open the subscription again. This happens after a resubscribe or whenever there are no event logs to read, which is often. As a result, this error gets logged constantly:

"Failed to re-open subscription for remote server"..."error: subscription handle is already open"

To fix this, the handle should only attempt to re-open when the resubscribe happens.

This is a followup to #35175 which fixed that resubscribe issue for the user that raised it, but they have also been confused by this error being logged.

Link to tracking Issue: N/A

Testing: Manually verified log collection is successful before and after remote host reconnects, and that the noisy error is silenced except during resubscribe, where it is relevant.

Documentation: N/A

Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please take a look @pjanotti

Copy link
Contributor

@pjanotti pjanotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not from this change, but, this seems to leak the remote session handle, since closing the subscription doesn't closes it. That said I think this happened because the way the code is structured: this would have been avoided if the remote session handle was also part of the subscription.

pkg/stanza/operator/input/windows/input.go Show resolved Hide resolved
pkg/stanza/operator/input/windows/input.go Show resolved Hide resolved
@kuiperda kuiperda force-pushed the fix/remote-windows-noisy-error branch from 7a2d1c1 to d62ab10 Compare October 2, 2024 15:21
@kuiperda kuiperda requested a review from pjanotti October 2, 2024 15:25
@kuiperda
Copy link
Contributor Author

kuiperda commented Oct 2, 2024

@pjanotti Thanks for your feedback. I updated the return for that function.

Copy link
Contributor

@pjanotti pjanotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kuiperda LGTM - if you can't start working soon on the remote session handle leak, could you, please, create a issue so we don't forget about it?

@kuiperda
Copy link
Contributor Author

kuiperda commented Oct 3, 2024

@pjanotti I'll make the issue but likely will not have time to work on it.

@djaglowski djaglowski merged commit 1a40ff5 into open-telemetry:main Oct 3, 2024
156 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 3, 2024
@kuiperda kuiperda deleted the fix/remote-windows-noisy-error branch October 3, 2024 14:15
jriguera pushed a commit to springernature/opentelemetry-collector-contrib that referenced this pull request Oct 4, 2024
… successfully (open-telemetry#35520)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->

If `Input::read` returns 0, the operator will attempt to open the
subscription again. This happens after a resubscribe *or* whenever there
are no event logs to read, which is often. As a result, this error gets
logged constantly:
```
"Failed to re-open subscription for remote server"..."error: subscription handle is already open"
```
To fix this, the handle should only attempt to re-open when the
resubscribe happens.

This is a followup to open-telemetry#35175 which fixed that resubscribe issue for the
user that raised it, but they have also been confused by this error
being logged.

**Link to tracking Issue:** <Issue number if applicable> **N/A**

**Testing:** <Describe what testing was performed and which tests were
added.> Manually verified log collection is successful before and after
remote host reconnects, and that the noisy error is silenced except
during resubscribe, where it is relevant.

**Documentation:** <Describe the documentation added.> **N/A**
ghost pushed a commit to sematext/opentelemetry-collector-contrib that referenced this pull request Oct 9, 2024
… successfully (open-telemetry#35520)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->

If `Input::read` returns 0, the operator will attempt to open the
subscription again. This happens after a resubscribe *or* whenever there
are no event logs to read, which is often. As a result, this error gets
logged constantly:
```
"Failed to re-open subscription for remote server"..."error: subscription handle is already open"
```
To fix this, the handle should only attempt to re-open when the
resubscribe happens.

This is a followup to open-telemetry#35175 which fixed that resubscribe issue for the
user that raised it, but they have also been confused by this error
being logged.

**Link to tracking Issue:** <Issue number if applicable> **N/A**

**Testing:** <Describe what testing was performed and which tests were
added.> Manually verified log collection is successful before and after
remote host reconnects, and that the noisy error is silenced except
during resubscribe, where it is relevant.

**Documentation:** <Describe the documentation added.> **N/A**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants