10000 gh-121723: Relax constraints on queue objects for `logging.handlers.QueueHandler`. by picnixz · Pull Request #122154 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-121723: Relax constraints on queue objects for logging.handlers.QueueHandler. #122154

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

Merged
merged 15 commits into from
Aug 2, 2024

Conversation

picnixz
Copy link
Member
@picnixz picnixz commented Jul 23, 2024

Not sure if I need to explain what the Queue public API is. I think people are smart enough to understand that we expect a Queue-like object but tell me if you want me to put more details here.


📚 Documentation preview 📚: https://cpython-previews--122154.org.readthedocs.build/

picnixz added 4 commits July 23, 2024 11:13
Any object implementing the Queue public API can be used
for configuring a QueueHandler. Only the presence of the
methods is checked, but not their signature.
Copy link
Member
@vsajip vsajip left a comment

Choose a reason for hiding this comment

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

Looks good, but I have two thoughts:

  1. Should the actual test for a queue protocol be factored out into an is_queue function? I know 8000 it'll only be used once, but it might make the overall flow slightly more readable.
  2. Is it worth adding a test for the specific failure condition of multiprocessing.Pool in spawn mode breaks logging.handlers.QueueHandler configuration #121723 (multiprocessing.set_start_method('spawn'))?

@picnixz
Copy link
Member Author
picnixz commented Jul 24, 2024
  1. Yes but I wasn't sure you wanted this in the module. AFAICT, the logging library likes to have long functions :)
  2. This one requires a debug build (otherwise the assert is not executed) but I'll see if I can test it in debug only (I think the behaviour will become buggy in release mode).

@picnixz picnixz requested a review from vsajip July 27, 2024 10:20
@vsajip vsajip added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 27, 2024
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @vsajip for commit 7729fb6 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 27, 2024
Copy link
Member Author
@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

@vsajip Before merging, I'll need to fix some typos so don't enable the automerge (I'm waiting for the build bots to finish).

@picnixz
Copy link
Member Author
picnixz commented Jul 27, 2024

I'm waiting for the build bots to finish

Good thing I didn't wait in front of my screen, thinking it would finish FAST! I'll update my branch tomorrow.

@vsajip vsajip added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 31, 2024
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @vsajip for commit d6b6ef3 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 31, 2024
@picnixz
Copy link
Member Author
picnixz commented Jul 31, 2024
  • Ok, so https://buildbot.python.org/#/builders/1295/builds/224 is a legit failure (it's just that queue is empty, but I suspect it's either an issue with the FT build or the timeout is not just enough).
  • The other on AMD64 Arch Linux Usan 3.x/4532 is something I found on other PRs as well.

@vsajip
Copy link
Member
vsajip commented Aug 1, 2024

or the timeout is not just enough

Do you want to try increasing the timeout?

@picnixz
Copy link
Member Author
picnixz commented Aug 1, 2024

Do you want to try increasing the timeout?

For the sake of the test, I'll try but I'm not sure whether it's really a timeout issue or not. I'll put it at 60s (if it fails, then it's probably something else but it's probably something related to multiprocessing then).

@picnixz
Copy link
Member Author
picnixz commented Aug 1, 2024

Can you run a single build bot actually? namely AMD64 Windows Server 2022 NoGIL PR/224? it appears that there are also other issues with multiprocessing for it but I'm not sure if they are related...

@vsajip
Copy link
Member
vsajip commented Aug 2, 2024

I've asked that bot to rerun. I assume it'll pick up your latest changes - https://buildbot.python.org/#/builders/1295/builds/226

@picnixz
Copy link
Member Author
picnixz commented Aug 2, 2024

It appears that the only failure is not related to this PR:

FAIL: test_search_major_2 (test.test_launcher.TestLauncher.test_search_major_2)
FAIL: test_search_major_3 (test.test_launcher.TestLauncher.test_search_major_3)
Re-running test_launcher in verbose mode (matching: test_search_major_2, test_search_major_3)
FAIL: test_search_major_2 (test.test_launcher.TestLauncher.test_search_major_2)
FAIL: test_search_major_3 (test.test_launcher.TestLauncher.test_search_major_3)

@vsajip vsajip merged commit fb864c7 into python:main Aug 2, 2024
36 checks passed
@miss-islington-app
Copy link

Thanks @picnixz for the PR, and @vsajip for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 2, 2024
…lers.QueueHandler`. (pythonGH-122154)

(cherry picked from commit fb864c7)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app
Copy link
bedevere-app bot commented Aug 2, 2024

GH-122603 is a backport of this pull request to the 3.13 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 2, 2024
…lers.QueueHandler`. (pythonGH-122154)

(cherry picked from commit fb864c7)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Aug 2, 2024
@bedevere-app
Copy link
bedevere-app bot commented Aug 2, 2024

GH-122604 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Aug 2, 2024
@picnixz picnixz deleted the queue-protocol-in-logging branch August 2, 2024 11:19
vsajip pushed a commit that referenced this pull request Aug 2, 2024
vsajip pushed a commit that referenced this pull request Aug 2, 2024
brandtbucher pushed a commit to brandtbucher/cpython that referenced this pull request Aug 7, 2024
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
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
0