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

Starting view och json after manager is running cause metrics server to be started a second time #657

Open
jhoglin opened this issue May 20, 2021 · 3 comments

Comments

@jhoglin
Copy link

jhoglin commented May 20, 2021

I'm too new with Python but this global handling must be broken somhow.

Starting manager first

python3 manager.py start
Plot Manager has started...

then start the view, the view process has no knowledge about the global PROCESSED from start of manager, so it will try to start a second server using the same port and the result is:

python3 manager.py view
              ->   processed 1 False.    # MY OWN PRINT TO DEBUG THIS
Traceback (most recent call last):
  File "/home/jhoglin/chia/Swar-Chia-Plot-Manager/manager.py", line 37, in <module>
    view()
  File "/home/jhoglin/chia/Swar-Chia-Plot-Manager/plotmanager/library/utilities/commands.py", line 162, in view
    jobs, running_work = get_running_plots(jobs=jobs, running_work=running_work,
  File "/home/jhoglin/chia/Swar-Chia-Plot-Manager/plotmanager/library/utilities/processes.py", line 254, in get_running_plots
    set_plots_running(total_running_plots=assumed_job.total_running, job_name=assumed_job.name,
  File "/home/jhoglin/chia/Swar-Chia-Plot-Manager/plotmanager/library/utilities/instrumentation.py", line 26, in set_plots_running
    _get_metrics(instrumentation_settings=instrumentation_settings)
  File "/home/jhoglin/chia/Swar-Chia-Plot-Manager/plotmanager/library/utilities/instrumentation.py", line 20, in _get_metrics
    start_http_server(port)
  File "/home/jhoglin/chia/Swar-Chia-Plot-Manager/venv/lib/python3.9/site-packages/prometheus_client/exposition.py", line 149, in start_wsgi_server
    httpd = make_server(addr, port, app, ThreadingWSGIServer, handler_class=_SilentHandler)
  File "/usr/lib/python3.9/wsgiref/simple_server.py", line 154, in make_server
    server = server_class((host, port), handler_class)
  File "/usr/lib/python3.9/socketserver.py", line 452, in __init__
    self.server_bind()
  File "/usr/lib/python3.9/wsgiref/simple_server.py", line 50, in server_bind
    HTTPServer.server_bind(self)
  File "/usr/lib/python3.9/http/server.py", line 138, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.9/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
@iwex
Copy link

iwex commented May 21, 2021

I have the same issue

@iwex
Copy link

iwex commented May 21, 2021

Tried to fix :) #660

@iwex
Copy link

iwex commented May 21, 2021

Anyway, it's not working correctly. When I restart the manager it fails to update values, so for now it responds only with 1 job running..

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

No branches or pull requests

2 participants