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

Fix crash when fcgi-program socket is already bound #1568

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

Conversation

0xbad0c0d3
Copy link

fixes issue #1567

@mnaberez
Copy link
Member

Description from #1567:

How to reproduce

example program config:

[fcgi-program:test]
command=/bin/true
socket=tcp://0.0.0.0:8000

# socat tcp4-l:8000 stdio

# supervisord -n 
2023-01-27 12:49:46,946 INFO Set uid to user 11 succeeded
2023-01-27 12:49:46,947 INFO Creating socket tcp://0.0.0.0:8000
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/supervisor/process.py", line 839, in __init__
    self.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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/supervisord", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/site-packages/supervisor/supervisord.py", line 361, in main
    go(options)
  File "/usr/local/lib/python3.10/site-packages/supervisor/supervisord.py", line 371, in go
    d.main()
  File "/usr/local/lib/python3.10/site-packages/supervisor/supervisord.py", line 78, in main
    self.run()
  File "/usr/local/lib/python3.10/site-packages/supervisor/supervisord.py", line 86, in run
    self.add_process_group(config)
  File "/usr/local/lib/python3.10/site-packages/supervisor/supervisord.py", line 119, in add_process_group
    self.process_groups[name] = config.make_group()
  File "/usr/local/lib/python3.10/site-packages/supervisor/options.py", line 2046, in make_group
    return FastCGIProcessGroup(self)
  File "/usr/local/lib/python3.10/site-packages/supervisor/process.py", line 841, in __init__
    raise ValueError(
ValueError: Could not create FastCGI socket tcp://0.0.0.0:8000: [Errno 98] Address in use
# 

@mnaberez mnaberez changed the title 1567 fix Fix crash when fcgi-program socket is already bound Jan 27, 2023
@val-melev
Copy link

Hi, is there any plans to merge & release this? Would be very helpful to lots of people, I'm sure!

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.

3 participants