Skip to content

Suppress garbageHandler log warnings#15778

Merged
seanbudd merged 3 commits intomasterfrom
suppressGarbageHandler
Nov 22, 2023
Merged

Suppress garbageHandler log warnings#15778
seanbudd merged 3 commits intomasterfrom
suppressGarbageHandler

Conversation

@seanbudd
Copy link
Member

@seanbudd seanbudd commented Nov 13, 2023

Link to issue number:

Fixes #15634

Summary of the issue:

The information provided by garbageHandler is very noisy, and not indicative of a high priority fatal error.

Description of user facing changes

Less noisy logs, and less frequent error bells on dev builds of NVDA.

Description of development approach

Instead of logging every object on deletion, only log the number of objects deleted at "warning" level.
Logging every object can be enabled by enabling debug logging for garbageHandler.

Testing strategy:

Manual testing

Known issues with pull request:

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@seanbudd seanbudd requested a review from a team as a code owner November 13, 2023 04:50
@CyrilleB79
Copy link
Contributor

@seanbudd, please also update the documentation, i.e. projectDocs/design/unreachableObjects.md.
Thanks.

log.error(f"Found at least {_reportCountDuringCollection} unreachable objects in run")
log.debugWarning(f"Found at least {_reportCountDuringCollection} unreachable objects in run")
else:
log.error(f"Unknown action: {action}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this remain logged at error level, so that if there are any additions to the actions supported by Python's gc interface, we are warned in advance?

@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Nov 21, 2023
@seanbudd seanbudd merged commit 938d9b5 into master Nov 22, 2023
@seanbudd seanbudd deleted the suppressGarbageHandler branch November 22, 2023 02:09
@nvaccessAuto nvaccessAuto added this to the 2024.1 milestone Nov 22, 2023
@ultrasound1372
Copy link

I think this PR also addresses #15356, so that can probably be closed too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python 3.11 regression: Garbage handler errors occur much more frequently

6 participants