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

gunicorn worker should use create_unix_server for AF_UNIX sockets. #1375

Merged
merged 1 commit into from
Nov 7, 2016

Conversation

1st1
Copy link
Contributor

@1st1 1st1 commented Nov 6, 2016

What do these changes do?

Use loop.create_unix_server for AF_UNIX sockets. Right now it works only accidentally. Unix sockets are sufficiently different from TCP sockets, and we should use the correct APIs for them.

Are there changes in behavior for the user?

No.

Related issue number

uvloop raises an exception when gunicorn is configured to use a UNIX socket: MagicStack/uvloop#59

@codecov-io
Copy link

codecov-io commented Nov 6, 2016

Current coverage is 98.75% (diff: 50.00%)

Merging #1375 into master will decrease coverage by 0.02%

@@             master      #1375   diff @@
==========================================
  Files            29         29          
  Lines          6762       6765     +3   
  Methods           0          0          
  Messages          0          0          
  Branches       1123       1124     +1   
==========================================
+ Hits           6680       6681     +1   
- Misses           38         39     +1   
- Partials         44         45     +1   

Powered by Codecov. Last update 70d4cb0...27c7f99

@asvetlov asvetlov merged commit ef91203 into aio-libs:master Nov 7, 2016
@asvetlov
Copy link
Member

asvetlov commented Nov 7, 2016

Thanks

asvetlov added a commit that referenced this pull request Nov 7, 2016
@asvetlov
Copy link
Member

asvetlov commented Nov 7, 2016

Thanks

@asvetlov
Copy link
Member

asvetlov commented Nov 7, 2016

Please wait for aiohttp 1.1 bugfix release

@shturman
Copy link

shturman commented Nov 9, 2016

I'm start getting errors from aiohttp.worker.GunicornUVLoopWebWorker after this fix:

[ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/gunicorn/arbiter.py", line 557, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/worker.py", line 201, in init_process
    super().init_process()
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/worker.py", line 37, in init_process
    super().init_process()
  File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base.py", line 132, in init_process
    self.run()
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/worker.py", line 44, in run
    self.loop.run_until_complete(self._runner)
  File "uvloop/loop.pyx", line 1148, in uvloop.loop.Loop.run_until_complete (uvloop/loop.c:20673)
  File "uvloop/future.pyx", line 146, in uvloop.loop.BaseFuture.result (uvloop/loop.c:94148)
  File "uvloop/future.pyx", line 101, in uvloop.loop.BaseFuture._result_impl (uvloop/loop.c:93687)
  File "uvloop/future.pyx", line 372, in uvloop.loop.BaseTask._fast_step (uvloop/loop.c:97209)
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/worker.py", line 95, in _run
    handler, sock=sock.sock, ssl=ctx)
  File "uvloop/loop.pyx", line 1606, in create_unix_server (uvloop/loop.c:26502)
ValueError: A UNIX Domain Stream Socket was expected, got <socket.socket fd=6, family=AddressFamily.AF_UNIX, type=2049, proto=0, laddr=/tmp/gunicorn.sock>

uvloop: 0.6.0

@1st1
Copy link
Contributor Author

1st1 commented Nov 9, 2016

Oh, I guess I know what's the issue. Give me a couple of hours and I'll push the fix.

@1st1
Copy link
Contributor Author

1st1 commented Nov 10, 2016

I'm start getting errors from aiohttp.worker.GunicornUVLoopWebWorker after this fix:

@shturman Fixed in uvloop v0.6.1.

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants