As mentioned before. Do not use the bottle built-in reloader. It is for a different use case. Also the reloader is not meant to with with gunicorn (because multiprocess). only this should work:
bottle.run(server='tornado', host=host, port=int(port)) On Saturday, 18 May 2019 04:49:41 UTC-7, 黄祥 wrote: > > test reload apps with gunicorn server and reloader=True, can run at first, > but when hit 'reload apps' it return an error on terminal > *web3py/web3py/core.py* > bottle.run(server='gunicorn', host=host, port=int(port), reloader=True) > > [2019-05-18 18:43:48 +0700] [47687] [INFO] Starting gunicorn 19.9.0 > [2019-05-18 18:43:48 +0700] [47687] [INFO] Listening at: http:// > 127.0.0.1:8000 (47687) > [2019-05-18 18:43:48 +0700] [47687] [INFO] Using worker: sync > [2019-05-18 18:43:48 +0700] [47691] [INFO] Booting worker with pid: 47691 > [2019-05-18 18:44:13 +0700] [47687] [INFO] Handling signal: int > Traceback (most recent call last): > File > "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gunicorn/workers/base.py" > , line 190, in handle_quit > time.sleep(0.1) > File > "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/hub.py" > , line 159, in sleep > hub.wait(t) > File "src/gevent/_hub_primitives.py", line 46, in gevent. > __hub_primitives.WaitOperationsGreenlet.wait > File "src/gevent/_hub_primitives.py", line 55, in gevent. > __hub_primitives.WaitOperationsGreenlet.wait > File "src/gevent/_waiter.py", line 151, in gevent.__waiter.Waiter.get > File "src/gevent/_greenlet_primitives.py", line 60, in gevent. > __greenlet_primitives.SwitchOutGreenletWithLoop.switch > File "src/gevent/_greenlet_primitives.py", line 60, in gevent. > __greenlet_primitives.SwitchOutGreenletWithLoop.switch > File "src/gevent/_greenlet_primitives.py", line 63, in gevent. > __greenlet_primitives.SwitchOutGreenletWithLoop.switch > File "src/gevent/_greenlet_primitives.py", line 66, in gevent. > __greenlet_primitives.SwitchOutGreenletWithLoop.switch_out > File "src/gevent/_greenlet_primitives.py", line 67, in gevent. > __greenlet_primitives.SwitchOutGreenletWithLoop.switch_out > gevent.exceptions.BlockingSwitchOutError: Impossible to call blocking > function in the event loop callback > 2019-05-18T11:44:13Z > [2019-05-18 18:44:13 +0700] [47691] [ERROR] Exception in worker process > Traceback (most recent call last): > File > "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gunicorn/arbiter.py" > , line 583, in spawn_worker > worker.init_process() > File > "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gunicorn/workers/base.py" > , line 134, in init_process > self.run() > File > "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gunicorn/workers/sync.py" > , line 124, in run > self.run_for_one(timeout) > File > "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gunicorn/workers/sync.py" > , line 83, in run_for_one > self.wait(timeout) > File > "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gunicorn/workers/sync.py" > , line 35, in wait > ret = select.select(self.wait_fds, [], [], timeout) > File > "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/select.py" > , line 169, in select > return result.select(rlist, wlist, timeout) > File > "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/select.py" > , line 110, in select > self.event.wait(timeout=timeout) > File "src/gevent/event.py", line 127, in gevent._event.Event.wait > File "src/gevent/_abstract_linkable.py", line 192, in gevent. > __abstract_linkable.AbstractLinkable._wait > File "src/gevent/_abstract_linkable.py", line 165, in gevent. > __abstract_linkable.AbstractLinkable._wait_core > File "src/gevent/_abstract_linkable.py", line 169, in gevent. > __abstract_linkable.AbstractLinkable._wait_core > File "src/gevent/_greenlet_primitives.py", line 60, in gevent. > __greenlet_primitives.SwitchOutGreenletWithLoop.switch > File "src/gevent/_greenlet_primitives.py", line 60, in gevent. > __greenlet_primitives.SwitchOutGreenletWithLoop.switch > File "src/gevent/_greenlet_primitives.py", line 64, in gevent. > __greenlet_primitives.SwitchOutGreenletWithLoop.switch > File "src/gevent/__greenlet_primitives.pxd", line 35, in gevent. > __greenlet_primitives._greenlet_switch > gevent.exceptions.BlockingSwitchOutError: Impossible to call blocking > function in the event loop callback > [2019-05-18 18:44:13 +0700] [47691] [INFO] Worker exiting (pid: 47691) > [2019-05-18 18:44:14 +0700] [47687] [INFO] Shutting down: Master > > best regards, > stifan > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/dfc04861-e24c-432a-a8b9-b9baacb1055e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.