mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-26 11:30:23 +00:00
Have confluent log sessions out at exit
While the native perl threading object will do join() on exit, eventlet's variant does not. Fix this by manually hooking join() in via atexit. Since this is an eventlet specific thing, it makes sense to work the issue in code that patches in eventlet rather than in pyghmi itself.
This commit is contained in:
parent
4090dac50c
commit
a28b67e9aa
@ -13,6 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import atexit
|
||||
import confluent.exceptions as exc
|
||||
import confluent.interface.console as conapi
|
||||
import confluent.messages as msg
|
||||
@ -30,6 +31,12 @@ import socket
|
||||
console.session.select = eventlet.green.select
|
||||
console.session.threading = eventlet.green.threading
|
||||
|
||||
|
||||
def exithandler():
|
||||
console.session.iothread.join()
|
||||
|
||||
atexit.register(exithandler)
|
||||
|
||||
_ipmiworkers = greenpool.GreenPool()
|
||||
|
||||
_ipmithread = None
|
||||
|
Loading…
Reference in New Issue
Block a user