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

Improve exception handling for fcgi-program socket creation #1570

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

0xbad0c0d3
Copy link

fixes #1569

@mnaberez
Copy link
Member

Description from #1569:

How to reproduce

  1. Supervisord must already be started
  2. Add such a config:
[fcgi-program:test]
command=/bin/true
socket=tcp://0.0.0.0:8000
  1. start a program which listen to the port # socat tcp4-l:8000 stdio

  2. # supervisorctl update test

You'll see such an error in the supervisord console

2023-01-27 13:03:20,563 INFO Creating socket tcp://0.0.0.0:8000
2023-01-27 13:03:20,564 ERRO XML-RPC response callback error:Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/supervisor/xmlrpc.py", line 78, in more
    value = self.callback()
  File "/usr/local/lib/python3.10/site-packages/supervisor/rpcinterface.py", line 947, in allfunc
    callback = func(name, **extra_kwargs)
  File "/usr/local/lib/python3.10/site-packages/supervisor/rpcinterface.py", line 301, in startProcess
    process.spawn()
  File "/usr/local/lib/python3.10/site-packages/supervisor/process.py", line 717, in spawn
    self.before_spawn()
  File "/usr/local/lib/python3.10/site-packages/supervisor/process.py", line 711, in before_spawn
    self.fcgi_sock = self.group.socket_manager.get_socket()
  File "/usr/local/lib/python3.10/site-packages/supervisor/socket_manager.py", line 74, in get_socket
    self.ref_ctr.increment()
  File "/usr/local/lib/python3.10/site-packages/supervisor/socket_manager.py", line 36, in increment
    self.on_non_zero()
  File "/usr/local/lib/python3.10/site-packages/supervisor/socket_manager.py", line 90, in _prepare_socket
    self.socket = self.socket_config.create_and_bind()
  File "/usr/local/lib/python3.10/site-packages/supervisor/datatypes.py", line 210, in create_and_bind
    sock.bind(self.addr())
OSError: [Errno 98] Address in use

as a result supervisord would not even add the program, and no status would be shown

@mnaberez mnaberez changed the title 1569 fix Improve exception handling for fcgi-program socket creation Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Improving exception handling for fcgi-program socket creation
2 participants