Skip to content

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

Merged
vsajip merged 15 commits into
python:mainfrom
picnixz:queue-protocol-in-logging
Aug 2, 2024
Merged

gh-121723: Relax constraints on queue objects for logging.handlers.QueueHandler.#122154
vsajip merged 15 commits into
python:mainfrom
picnixz:queue-protocol-in-logging

Conversation

@picnixz

@picnixz picnixz commented Jul 23, 2024

Copy link
Copy Markdown
Member

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.

@vsajip vsajip left a comment

Copy link
Copy Markdown
Member

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 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 #121723 (multiprocessing.set_start_method('spawn'))?

@picnixz

picnixz commented Jul 24, 2024

Copy link
Copy Markdown
Member Author
  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
Copy Markdown

🤖 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

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member Author

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).

Comment thread Lib/logging/config.py Outdated
Comment thread Lib/test/test_logging.py Outdated
Comment thread Lib/test/test_logging.py Outdated
@picnixz

picnixz commented Jul 27, 2024

Copy link
Copy Markdown
Member Author

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
Copy Markdown

🤖 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

picnixz commented Jul 31, 2024

Copy link
Copy Markdown
Member Author
  • 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

vsajip commented Aug 1, 2024

Copy link
Copy Markdown
Member

or the timeout is not just enough

Do you want to try increasing the timeout?

@picnixz

picnixz commented Aug 1, 2024

Copy link
Copy Markdown
Member Author

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

picnixz commented Aug 1, 2024

Copy link
Copy Markdown
Member Author

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

vsajip commented Aug 2, 2024

Copy link
Copy Markdown
Member

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

picnixz commented Aug 2, 2024

Copy link
Copy Markdown
Member Author

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
@miss-islington-app

Copy link
Copy Markdown

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

bedevere-app Bot commented Aug 2, 2024

Copy link
Copy Markdown

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

bedevere-app Bot commented Aug 2, 2024

Copy link
Copy Markdown

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