def get_executor_instance(env, actionExecutor):
    global executor_instance
    if not executor_instance:
        fqcn = env.get_property(DEFAULT_CONFIG_FILE, PROPERTY_EXECUTOR_CLASS, DEFAULT_EXECUTOR_CLASS)
        env.log("Creating a new executor instance of {}".format(fqcn))
        klass = find_class(fqcn)
        executor_instance = klass(env, actionExecutor)
    # NOT THREAD SAFE
    # even if we already had an instance of an executor the choreographe object might have become
    # stale so we refresh it. We only have one executor instance at once so this should be OK
    executor_instance.actionExecutor = actionExecutor
    return executor_instance