Skip to content
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

Possible race condition when using AuditSpinner #739

Open
i386x opened this issue Feb 18, 2024 · 4 comments
Open

Possible race condition when using AuditSpinner #739

i386x opened this issue Feb 18, 2024 · 4 comments
Labels
bug-candidate Might be a bug. needs-response Needs response from the reporter.

Comments

@i386x
Copy link

i386x commented Feb 18, 2024

Bug description

With --progress-spinner being on, either spinner text or memory-stored logs appears on the terminal, but not both.

Examples:

  • spinner message, no logs:
    py310: commands[0]> python -m pip_audit -S .
    - Collecting inputs
    py310: exit 1 (0.51 seconds) /home/jkucera/development/upstream/vutils-validator> python -m pip_audit -S . pid=47412
    
  • no spinner message, logs:
    py310: commands[0]> python -m pip_audit -S .
    ERROR:pip_audit._cli:pyproject file pyproject.toml does not contain `project` section
    py310: exit 1 (0.51 seconds) /home/jkucera/development/upstream/vutils-validator> python -m pip_audit -S . pid=47276
    

As a workaround, --progress-spinner need to be set to off:

py310: commands[0]> python -m pip_audit --progress-spinner off -S .
ERROR:pip_audit._cli:pyproject file pyproject.toml does not contain `project` section
py310: exit 1 (0.50 seconds) /home/jkucera/development/upstream/vutils-validator> python -m pip_audit --progress-spinner off -S . pid=47455

Reproduction steps

  1. Add python -m pip_audit -S . to your tox.ini file.
  2. Remove [project] section from your pyproject.toml file.
  3. Run tox multiple times and watch its behavior.

Expected behavior

Both spinner and logs should be displayed on the terminal.

Screenshots and logs

See examples above.

Platform information

  • OS name and version: Fedora Linux 37 (Workstation Edition)
  • pip-audit version (pip-audit -V): pip-audit 2.7.1
  • Python version (python -V or python3 -V): Python 3.10.12
  • pip version (pip -V or pip3 -V): pip 23.2.1
  • tox version: 3.28.0
@i386x i386x added the bug-candidate Might be a bug. label Feb 18, 2024
@woodruffw
Copy link
Member

Thanks for the report @i386x!

Hmm, this is odd -- we should always spit out the logs unconditionally after the spinner concludes. I haven't seen this behavior outside of being wrapped by a runner like tox, so I wonder if this is a case of lossy wrapping on the child process's stdout/stderr.

That's just a random guess though; I'll triage more later this week.

@woodruffw
Copy link
Member

I'll keep experimenting here, but I've been unable to reproduce this outside of a wrapper (I'll try tox later today).

@woodruffw
Copy link
Member

I've been unable to reproduce this. @i386x, are you able to create a reproducer that doesn't depend on tox?

@woodruffw woodruffw added the needs-response Needs response from the reporter. label May 1, 2024
@i386x
Copy link
Author

i386x commented May 1, 2024

I will try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-candidate Might be a bug. needs-response Needs response from the reporter.
Projects
None yet
Development

No branches or pull requests

2 participants