[Checkins] SVN: gocept.selenium/trunk/src/gocept/selenium/wsgi/__init__.py don't hang indefinitely if the http server cannot be shut down, complain after a time-out instead

Wolfgang Schnerring ws at gocept.com
Wed Jan 11 07:08:10 UTC 2012


* Thomas Lotze <tl-w5oghCfH6z/QT0dZR+AlfA at public.gmane.org> [2012-01-11 00:32]:
> Log message for revision 124024:
>
> Modified: gocept.selenium/trunk/src/gocept/selenium/wsgi/__init__.py
> ===================================================================
> --- gocept.selenium/trunk/src/gocept/selenium/wsgi/__init__.py	2012-01-10 23:31:33 UTC (rev 124023)
> +++ gocept.selenium/trunk/src/gocept/selenium/wsgi/__init__.py	2012-01-10 23:32:13 UTC (rev 124024)
> @@ -54,7 +54,9 @@
>  
>      def tearDown(self):
>          self.http.shutdown()
> -        self.thread.join()
> +        self.thread.join(5)
> +        if not self.thread.isAlive():
> +            raise RuntimeError('WSGI server could not be shut down')
>          # Make the server really go away and give up the socket:
>          self.http = None
>          super(Layer, self).tearDown()
>
>   don't hang indefinitely if the http server cannot be shut down, complain after a time-out instead

I fully agree with the intent, but I wonder if we can do something
better than raising-during-tearDown (which strikes me as not too
helpful). Silently ignoring sounds somewhat wrong, though... sigh.

Wolfgang


More information about the checkins mailing list