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

builtins.OSError when using HTTP server over unix sockets since Twisted 24.10.0 #12365

Closed
p12tic opened this issue Nov 18, 2024 · 1 comment · Fixed by #12366
Closed

builtins.OSError when using HTTP server over unix sockets since Twisted 24.10.0 #12365

p12tic opened this issue Nov 18, 2024 · 1 comment · Fixed by #12366
Labels

Comments

@p12tic
Copy link
Contributor

p12tic commented Nov 18, 2024

Since 24.10.0 it is not possible to use HTTP server over unix: protocol.

This bug has been initially reported in buildbot/buildbot#8207.

Relevant log:

2024-11-12 05:54:43+0000 [buildbot.www.service.BuildbotSite] Unhandled Error
        Traceback (most recent call last):
          File "/home/buildbot/venv/lib64/python3.13/site-packages/twisted/internet/tcp.py", line 1423, in doRead
            protocol.makeConnection(transport)
          File "/home/buildbot/venv/lib64/python3.13/site-packages/twisted/internet/protocol.py", line 509, in makeConnection
            self.connectionMade()
          File "/home/buildbot/venv/lib64/python3.13/site-packages/twisted/web/http.py", line 2336, in connectionMade
            self.transport.setTcpNoDelay(True)
          File "/home/buildbot/venv/lib64/python3.13/site-packages/twisted/internet/tcp.py", line 340, in setTcpNoDelay
            self.socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, enabled)
        builtins.OSError: [Errno 95] Operation not supported

Relevant Twisted configuration:

    port='unix:/run/buildbot/buildbot-loop-master.sock:mode=660',

Most likely #12312 is the cause of the regression because it introduces setTcpNoDelay to HTTP client. Unfortunately setTcpNoDelay is available on all stream sockets, which includes unix domain sockets. Setting TCP NODELAY option on them fails with error.

@adiroiban
Copy link
Member

adiroiban commented Nov 18, 2024

Many thanks for the report.

SO... we have the ITCPTransport interface that defined the setTcpNoDelay

We have IUNIXTransport which is the interface for our Unix socket transport

I guess that in the HTTP code we need to call self.transport.setTcpNoDelay(True) only if the transport implements the ITCPTransport interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants