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

'UnixDomainSocketConnection' object has no attribute 'socket_timeout' #2629

Closed
woutdenolf opened this issue Mar 20, 2023 · 8 comments · Fixed by #2630
Closed

'UnixDomainSocketConnection' object has no attribute 'socket_timeout' #2629

woutdenolf opened this issue Mar 20, 2023 · 8 comments · Fixed by #2630

Comments

@woutdenolf
Copy link
Contributor

Caused by the refactoring in #2588. I'll make a PR to fix it.

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/ewoksutils/logging_utils/connection.py", line 73, in emit
    self._send_serialized_record(s)
  File "/builds/workflow/ewoks/ewoksjob/src/ewoksjob/events/handlers/redis.py", line 49, in _send_serialized_record
    n = self._connection.incrby("ewoks_events_count")
  File "/usr/local/lib/python3.7/site-packages/redis/commands/core.py", line 1914, in incrby
    return self.execute_command("INCRBY", name, amount)
  File "/usr/local/lib/python3.7/site-packages/redis/client.py", line 1255, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
  File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 1441, in get_connection
    connection.connect()
  File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 699, in connect
    lambda: self._connect(), lambda error: self.disconnect(error)
  File "/usr/local/lib/python3.7/site-packages/redis/retry.py", line 46, in call_with_retry
    return do()
  File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 699, in <lambda>
    lambda: self._connect(), lambda error: self.disconnect(error)
  File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 1171, in _connect
    sock.settimeout(self.socket_timeout)
AttributeError: 'UnixDomainSocketConnection' object has no attribute 'socket_timeout'
@chayim
Copy link
Contributor

chayim commented Mar 20, 2023

Thanks @woutdenolf ... I won't lie, as a Star Wars fan, I loved everything ewok releated here :D

@woutdenolf
Copy link
Contributor Author

@chayim Then you'll love this project: https://ewoks.readthedocs.io

@hofrob
Copy link
Contributor

hofrob commented Mar 21, 2023

Wouldn't it make sense to nuke 4.5.2 altogether? This is a critical bug for those who use socket connections.

@woutdenolf
Copy link
Contributor Author

In that case you can nuke 4.5.0 as well.

@steve-mavens
Copy link

steve-mavens commented Mar 22, 2023

We've hit both #2581 and this one in our CI testing. Those tests use redislite to avoid needing a "real" Redis instance to test our code against. Hence these bugs only affect us when testing: they wouldn't affect our live code. Just an idea: could using redislite help this project to include a high-level test that UnixDomainSocketConnection is fit for use? Or is that not a reasonable test dependency? It does have a big restriction, which is that it doesn't install on Windows.

@woutdenolf
Copy link
Contributor Author

FYI I added connection tests for TCP, TCP-SSL and UDS in another PR: #2631. So at least the issues with 4.5.0 and 4.5.2 would be covered by those tests.

rgaudin added a commit to openzim/sotoki that referenced this issue Mar 22, 2023
@elderlabs
Copy link

elderlabs commented Mar 22, 2023

Also seeing this in testing with 4.5.2/4.5.3, and feel it may be related. #2636 may also be related. Error received is as follows:

File ".venv/lib/python3.10/site-packages/redis/client.py", line 1255, in execute_command
  conn = self.connection or pool.get_connection(command_name, **options)
File ".venv/lib/python3.10/site-packages/redis/connection.py", line 1436, in get_connection
  connection = self.make_connection()
File ".venv/lib/python3.10/site-packages/redis/connection.py", line 1476, in make_connection
  return self.connection_class(**self.connection_kwargs)
File ".venv/lib/python3.10/site-packages/redis/connection.py", line 1160, in __init__
  super().__init__(**kwargs)
TypeError: AbstractConnection.__init__() got an unexpected keyword argument 'socket_timeout'

If this is unrelated, I'm happy to file a new issue if needed. Seems the pending PR addresses this.
Thanks.

@woutdenolf
Copy link
Contributor Author

It seems that in the mean time, 4.5.3 and 5.0.0b1 have been released. So you can nuke 4.5.0, 4.5.2, 4.5.3 and 5.0.0b1. They all have broken UDS connections.

Please merge #2630 (fixes the issue) and #2631 (adds tests so this doesn't happen again) before making new releases @dvora-h @shacharPash .

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 a pull request may close this issue.

5 participants