mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	run-dev: Make address-in-use errors more obvious.
This seems to be a common enough pitfall to justify
a bit of extra handling.  Example output:
    $ ./tools/run-dev.py
    Clearing memcached ...
    Flushing memcached...
    OK
    Starting Zulip services on ports: web proxy: ...
    Note: only port 9991 is exposed to the host in a Vagrant environment.
    ERROR: You probably have another server running!!!
    Traceback (most recent call last):
      File "./tools/run-dev.py", line 421, in <module>
        app.listen(proxy_port, address=options.interface)
      File "/srv/zulip-py3-venv/lib/python3.5/...
        server.listen(port, address)
      File "/srv/zulip-py3-venv/lib/python3.5/...
        sockets = bind_sockets(port, address=address)
      File "/srv/zulip-py3-venv/lib/python3.5/...
        sock.bind(sockaddr)
    OSError: [Errno 98] Address already in use
    Terminated
			
			
This commit is contained in:
		@@ -417,7 +417,12 @@ print("".join((WARNING,
 | 
			
		||||
 | 
			
		||||
try:
 | 
			
		||||
    app = Application(enable_logging=options.enable_tornado_logging)
 | 
			
		||||
    app.listen(proxy_port, address=options.interface)
 | 
			
		||||
    try:
 | 
			
		||||
        app.listen(proxy_port, address=options.interface)
 | 
			
		||||
    except OSError as e:
 | 
			
		||||
        if e.errno == 98:
 | 
			
		||||
            print('\n\nERROR: You probably have another server running!!!\n\n')
 | 
			
		||||
        raise
 | 
			
		||||
    ioloop = IOLoop.instance()
 | 
			
		||||
    for s in (signal.SIGINT, signal.SIGTERM):
 | 
			
		||||
        signal.signal(s, shutdown_handler)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user