Skip to content

test: PyPy fixes #543

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

Closed
wants to merge 1 commit into from
Closed

test: PyPy fixes #543

wants to merge 1 commit into from

Conversation

tiran
Copy link
Member

@tiran tiran commented Oct 30, 2023

On PyPy 3.9 sock.close() sometimes fails with Bad file descriptor, because the fd is already closed. Silence the exception. The problem is not a bug in python-ldap.

Really use PyPy 3.9 in tox.ini.

On PyPy 3.9 `sock.close()` sometimes fails with `Bad file descriptor`,
because the fd is already closed. Silence the exception. The problem is
not a bug in python-ldap.

Really use PyPy 3.9 in `tox.ini`.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
@mistotebe
Copy link
Contributor

-1 on this: we should really figure out why the socket was closed already to an authoritative reason.

Being opportunistic and then masking the error risks hiding hard to diagnose high severity bugs which we've had a hard time with using heimdal etc. in the past (a library closes its file descriptor, the fd # is reused by independent code and the library closes that one too).

@tiran
Copy link
Member Author

tiran commented Oct 30, 2023

Be my guest and good luck figuring it out... The problem only occurs with PyPy 3.9 on GitHub Actions and only every few test runs. It's rather random. I have not been able to reproduce the issue locally either.

In the mean time, I can work around the issue by restarting the failed test manually.

@mistotebe
Copy link
Contributor

Ok, I've had a try and can reproduce this quite reliably (even with --jit off, I think). Indeed close() is called several times on the same fd in Test03_SimpleLDAPObjectWithFileno, however trying to debug this in gdb, I cannot see who is calling the close() in each instance. Unlike with CPython I can't seem to be able to extract the python stack at the time of that call. Have you had any success/do you have hints on how that could be achieved?

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.

2 participants