python / python/cpython

Remote debugger should be checked only if interpreter paused on STW

Open
#145,970 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

interpreter-core type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Feature or enhancement

Proposal:

Now it is checked every _Py_HandlePending call.

https://github.com/python/cpython/blob/1dfe99ae3bed6cac01732b47bf7fa637abadf51b/Python/ceval_gil.c#L1361-L1368

https://github.com/python/cpython/blob/1dfe99ae3bed6cac01732b47bf7fa637abadf51b/Python/ceval_gil.c#L1431-L1433

Should we move this under if ((breaker & _PY_EVAL_PLEASE_STOP_BIT) != 0)? If yes, I have a PR ready.

cc @pablogsal

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Python/ceval_gil.c at the referenced _Py_HandlePending call sites and compare the remote-debugger check with _PY_EVAL_PLEASE_STOP_BIT handling. Confirm the intended behavior for interpreters paused on STW, then run the relevant CPython interpreter tests or add coverage showing the check is not performed on every pending-call handling path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.