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

Add missing sock.close() to rpc _connect() #388

Merged
merged 1 commit into from
Jul 27, 2023
Merged

Add missing sock.close() to rpc _connect() #388

merged 1 commit into from
Jul 27, 2023

Conversation

ACharlyR
Copy link
Contributor

The socket was not closed if the _connect() function timed out. This lead to an unclosed socket every time a second instance of pyvisa attempted to connect to a device while the first instance of pyvisa still had an open connection.

With this fix, the second instance can back off and try again at a later time without reaching an irrecoverable state.

  • Closes # (insert issue number if relevant)
  • Executed black . && isort -c . && flake8 with no errors
  • The change is fully covered by automated unit tests
  • Documented in docs/ as appropriate
  • Added an entry to the CHANGES file

The socket was not closed if the _connect() function timed out.
This lead to an unclosed socket every time a second instance of
pyvisa attempted to connect to a device while the first instance
of pyvisa still had an open connection.

With this fix, the second instance can back off and try again at
a later time without reaching an irrecoverable state.
@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2023

Codecov Report

Merging #388 (1d767e0) into main (c33f4f2) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #388      +/-   ##
==========================================
- Coverage   23.05%   23.04%   -0.01%     
==========================================
  Files          22       22              
  Lines        3292     3293       +1     
  Branches      456      456              
==========================================
  Hits          759      759              
  Misses       2516     2516              
- Partials       17       18       +1     
Flag Coverage Δ
unittests 23.04% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
pyvisa_py/protocols/rpc.py 21.99% <0.00%> (-0.04%) ⬇️

Copy link
Member

@MatthieuDartiailh MatthieuDartiailh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@MatthieuDartiailh MatthieuDartiailh merged commit dc58253 into pyvisa:main Jul 27, 2023
15 checks passed
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