usnistgov / SpectrumBrowser

ITL
12 stars 11 forks source link

DataStreaming.py does not respond to KeyboardInterrupt #185

Closed djanderson closed 9 years ago

djanderson commented 9 years ago
$ python flask/DataStreaming.py 
Looking for local Config File :  /home/danderson/.msod/MSODConfig.json
Looking for global Config File /etc/msod/MSODConfig.json
Starting streaming server
Trying port  9000
(<class 'socket.error'>, error(98, 'Address already in use'), <traceback object at 0x7f9a9ebda368>)
Traceback (most recent call last):
  File "flask/DataStreaming.py", line 768, in startStreamingServer
    soc.bind(('0.0.0.0',p))
  File "/usr/local/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use
Trying port  9002
OccupancyServer: Accepting connections
  C-c C-c
  C-c C-c
  C-c C-c
Terminated

(I opened a second terminal and ran "kill" on the pid)

ranganathanm commented 9 years ago

72829769b12a3b7af72b127bf8946859438592a7

ranganathanm commented 9 years ago

Please retest. Thanks.

ranganathanm commented 9 years ago

OccupancyServer will still not die on ctrl-c Using python threads has this effect. I need to move to a multiprocess architecture. Note that I added -SIGKILL on occupancy service stop method.

ranganathanm commented 9 years ago

Fixed occupancyserver as well. It will die on ctrl-c

ranganathanm commented 9 years ago

Tested locally and it works for me (would be good for somebody else to test this as well) so I am closing this issue.