Skip to content

Remove custom createLock method in BaseLogHandler #1248

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

danigm
Copy link

@danigm danigm commented Feb 6, 2025

This patch removes the override of createLock method so this class will use the default logging.Handler method.

The tests are failing for python 3.13 because in this version there's a direct usage of self.lock instead of calling self.acquire(): https://github.com/python/cpython/blob/3.13/Lib/logging/__init__.py#L1025-L1026

This patch removes the override of createLock method so this class will
use the default logging.Handler method.

The tests are failing for python 3.13 because in this version there's a
direct usage of self.lock instead of calling self.acquire():
https://github.com/python/cpython/blob/3.13/Lib/logging/__init__.py#L1025-L1026
Copy link

google-cla bot commented Feb 6, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@EpicWink
Copy link

To keep the current behaviour (of not synchronising handling), you instead may want to set lock to some new dummy value, which implements the threading.Lock interface. For Python 3.12 and below compatibility, you will need to implement __enter__, __exit__, acquire, release, _at_fork_reinit

This patch adds a DummyLock to do not synchronising handling, as
suggested in the comment:
census-instrumentation#1248 (comment)
@bjorn-einar-bjartnes-4ss

👍 We were affected by this, causing tests to fail at Python 3.13. I tried to add these changes to the package directly in the project, and then things works again. Any idea of when this will be officially released in the public package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants