* Cherry-pick fix from #4659
This implementation is thread safe.
"""
# local is_exporting flag for each thread
# global lock shared among all threads, to make sure only one thread is exporting at a time
_lock = threading.Lock()
self._lock.acquire()
self._lock.release()
@staticmethod
def is_exporting():