catch greenlet.GreenletExit when shutting service down
This commit is contained in:
@@ -24,13 +24,13 @@ No fan-out support yet.
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import greenlet
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import greenlet
|
|
||||||
from carrot import connection as carrot_connection
|
from carrot import connection as carrot_connection
|
||||||
from carrot import messaging
|
from carrot import messaging
|
||||||
import eventlet
|
import eventlet
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
"""Generic Node baseclass for all workers that run on hosts."""
|
"""Generic Node baseclass for all workers that run on hosts."""
|
||||||
|
|
||||||
|
import greenlet
|
||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@@ -166,7 +167,10 @@ class Service(object):
|
|||||||
def kill(self):
|
def kill(self):
|
||||||
"""Destroy the service object in the datastore."""
|
"""Destroy the service object in the datastore."""
|
||||||
self.csetthread.kill()
|
self.csetthread.kill()
|
||||||
self.csetthread.wait()
|
try:
|
||||||
|
self.csetthread.wait()
|
||||||
|
except greenlet.GreenletExit:
|
||||||
|
pass
|
||||||
self.stop()
|
self.stop()
|
||||||
try:
|
try:
|
||||||
db.service_destroy(context.get_admin_context(), self.service_id)
|
db.service_destroy(context.get_admin_context(), self.service_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user