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

ResourceWarning: unclosed socket when password is invalid #211

Closed
petronny opened this issue Aug 7, 2023 · 2 comments
Closed

ResourceWarning: unclosed socket when password is invalid #211

petronny opened this issue Aug 7, 2023 · 2 comments
Labels
bug Something isn't working patch available

Comments

@petronny
Copy link

petronny commented Aug 7, 2023

  1. What versions are you using?

oracledb 1.3.2
python 3.11
oracle db 19c

  1. Is it an error or a hang or a crash?

Warning

  1. What error(s) or behavior you are seeing?

sockets to connections that cannot be open (e.g. password is invalid) are closed automatically:

  • Running python -Wall runtests.py backends.oracle.tests.TransactionalTests with cx-Oracle==8.3.0
$ python -Wall runtests.py backends.oracle.tests.TransactionalTests
Testing against Django installed in '/django/django' with up to 8 processes
Found 2 test(s).
Creating test database for alias 'default'...
Creating test user...
System check identified no issues (0 silenced).
..
----------------------------------------------------------------------
Ran 2 tests in 2.048s

OK
Destroying test database for alias 'default'...
Destroying test user...
Destroying test database tables...
  • Running python -Wall runtests.py backends.oracle.tests.TransactionalTests with oracledb==1.3.2
python runtests.py backends.oracle.tests.TransactionalTests
Testing against Django installed in '/django/django' with up to 8 processes
Found 2 test(s).
Creating test database for alias 'default'...
Creating test user...
System check identified no issues (0 silenced).
.Exception ignored in: <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 38016), raddr=('127.0.0.1', 1521)>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/traceback.py", line 236, in clear_frames
    tb.tb_frame.clear()
ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 38016), raddr=('127.0.0.1', 1521)>
.
----------------------------------------------------------------------
Ran 2 tests in 1.860s

OK
Destroying test database for alias 'default'...
Destroying test user...
Destroying test database tables...
  1. Does your application call init_oracle_client()?

No.

  1. Include a runnable Python script that shows the problem.

See above. Please refer to the comments in django #15841 for more information.

@petronny petronny added the bug Something isn't working label Aug 7, 2023
anthony-tuininga added a commit that referenced this issue Aug 7, 2023
@anthony-tuininga
Copy link
Member

I have pushed a patch that should correct this issue. If you are able to build from source you can verify that it corrects your issue as well.

@anthony-tuininga
Copy link
Member

This has been included in python-oracledb 1.4.0 which was just released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working patch available
Projects
None yet
Development

No branches or pull requests

2 participants