use gevent to deal with sync in the leader side