-
Notifications
You must be signed in to change notification settings - Fork 857
[FIX] Ability to listen to a socket passed as file descriptor #1281
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
Conversation
|
I realized today that not only AF_UNIX sockets can be passed as file descriptors. AF_INET / AF_INET6 sockets created by systemd, Supervisor or another orchestrator will be passed the same way to dependent services. In Python 3.8, we could have used Instead of trying to guess the correct family with some complex code, my proposition is to let users pass it as an argument and reuse the Hence a thumbor invocation would look like:
1, 2 and 10 are numeric values respectively associated to Python's socket |
|
Knowing to pass numbers is too magical? Another option to use https://github.com/tiran/socketfromfd which auto detects socket family and type. |
Much more interesting than argument cycling, indeed. I change the pull request to use it. [Edit] |
|
That looks much cleaner, indeed. Would you fix the test please? Looks like it's trying to mock not existing anymore |
Tomorrow. It's too late here to dig now into what are pip, virtualenv and the whole Python (2...) ecosystem. |
|
Sorry, the history of this branch is a mess but I had to rely on TravisCi to run tests. I tried to follow contribution instructions but could not set up a development environment on my machine. $ python -V
Python 3.8.2
$ pip -V
pip 20.0.2
$ poetry --version
Poetry version 1.0.5
$ pip install -e .[tests]
[...]
ERROR: remotecv 3.0.0 has requirement Pillow<8.0.0,>=7.0.0, but you'll have pillow 6.2.2 which is incompatible.
$ make test
[... many failing tests ...]
make[1]: *** [Makefile:57: unit] Segmentation fault (core dumped)
make[1]: Leaving directory '[...]/thumbor'
make: *** [Makefile:39: test] Error 2I noticed that, even on TravisCi, |
|
we should probably limit remotecv version to be below 3 for thumbor 6 |
|
Should we cherry pick this to master? |
|
We should. Not sure if python's |
|
Do you mind cherry-picking it? If you can't, I'll find some time to do it. Please be mindful of time spent here. Your safety and getting your loved ones safe is the most important thing. We can always work things out here later on! :) Hope you are safe and everyone you love as well. |
Should fix #1269.