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

Reduce log spam on conhost exit #18629

Merged
merged 1 commit into from
Feb 25, 2025
Merged

Reduce log spam on conhost exit #18629

merged 1 commit into from
Feb 25, 2025

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Feb 25, 2025

When the server handle gets closed on conhost (= terminal is gone),
and e.g. PowerShell is used, we would previously log 6 error messages.
This PR reduces it to zero, by removing the 3 biggest offenders.

@lhecker lhecker added Product-Conhost For issues in the Console codebase Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. labels Feb 25, 2025
cbOutBufferSize,
&cbWritten,
nullptr));
RETURN_IF_WIN32_BOOL_FALSE_EXPECTED(DeviceIoControl(
Copy link
Member Author

Choose a reason for hiding this comment

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

This one in particular is redundant with the log calls in all the other existing places. It's IMO not very interesting to see a message stating that DeviceIoControl failed, if the caller then logs the returned HRESULT again. The caller signature gives much more information IMO (source and type of the call).

Copy link
Member

Choose a reason for hiding this comment

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

thank you. ugh.

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

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

Nice! Shipit!

@lhecker lhecker merged commit 0df8268 into main Feb 25, 2025
19 checks passed
@lhecker lhecker deleted the dev/lhecker/conhost-log-spam branch February 25, 2025 19:50
DHowett pushed a commit that referenced this pull request Feb 26, 2025
When the server handle gets closed on conhost (= terminal is gone),
and e.g. PowerShell is used, we would previously log 6 error messages.
This PR reduces it to zero, by removing the 3 biggest offenders.

(cherry picked from commit 0df8268)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXsQ64
Service-Version: 1.23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Product-Conhost For issues in the Console codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants