Esempio n. 1
0
def stop_infra():
    if common.INFRA_STOPPED:
        return
    common.INFRA_STOPPED = True

    event_publisher.fire_event(event_publisher.EVENT_STOP_INFRA)
    analytics.log.event("infra_stop")

    try:
        generic_proxy.QUIET = True
        LOG.debug("[shutdown] Cleaning up services ...")
        SERVICE_PLUGINS.stop_all_services()
        LOG.debug("[shutdown] Cleaning up files ...")
        common.cleanup(files=True, quiet=True)
        LOG.debug("[shutdown] Cleaning up resources ...")
        common.cleanup_resources()

        if config.FORCE_SHUTDOWN:
            LOG.debug(
                "[shutdown] Force shutdown, not waiting for infrastructure to shut down"
            )
            return

        LOG.debug("[shutdown] Waiting for infrastructure to shut down ...")
        wait_for_infra_shutdown()
        LOG.debug("[shutdown] Infrastructure is shut down")
    finally:
        SHUTDOWN_INFRA.set()
Esempio n. 2
0
def stop_infra():
    if common.INFRA_STOPPED:
        return
    # also used to signal shutdown for edge proxy so that any further requests will be rejected
    common.INFRA_STOPPED = True  # TODO: should probably be STOPPING since it isn't stopped yet

    event_publisher.fire_event(event_publisher.EVENT_STOP_INFRA)
    analytics.log.event("infra_stop")

    try:
        generic_proxy.QUIET = True  # TODO: this doesn't seem to be doing anything
        LOG.debug("[shutdown] Cleaning up services ...")
        SERVICE_PLUGINS.stop_all_services()
        LOG.debug("[shutdown] Cleaning up files ...")
        common.cleanup(files=True, quiet=True)
        LOG.debug("[shutdown] Cleaning up resources ...")
        common.cleanup_resources()

        if config.FORCE_SHUTDOWN:
            LOG.debug("[shutdown] Force shutdown, not waiting for infrastructure to shut down")
            return

        LOG.debug("[shutdown] Waiting for infrastructure to shut down ...")
        wait_for_infra_shutdown()
        LOG.debug("[shutdown] Infrastructure is shut down")
    finally:
        SHUTDOWN_INFRA.set()
Esempio n. 3
0
def stop_infra():
    if common.INFRA_STOPPED:
        return
    common.INFRA_STOPPED = True

    event_publisher.fire_event(event_publisher.EVENT_STOP_INFRA)

    try:
        generic_proxy.QUIET = True
        LOG.debug('[shutdown] Cleaning up files ...')
        common.cleanup(files=True, quiet=True)
        LOG.debug('[shutdown] Cleaning up resources ...')
        common.cleanup_resources()
        LOG.debug('[shutdown] Cleaning up Lambda resources ...')
        lambda_api.cleanup()

        if config.FORCE_SHUTDOWN:
            LOG.debug(
                '[shutdown] Force shutdown, not waiting for infrastructure to shut down'
            )
            return

        LOG.debug('[shutdown] Waiting for infrastructure to shut down ...')
        wait_for_infra_shutdown()
        LOG.debug('[shutdown] Infrastructure is shut down')
    finally:
        SHUTDOWN_INFRA.set()
Esempio n. 4
0
def stop_infra():
    if events.infra_stopping.is_set():
        return
    # also used to signal shutdown for edge proxy so that any further requests will be rejected
    events.infra_stopping.set()

    event_publisher.fire_event(event_publisher.EVENT_STOP_INFRA)
    analytics.log.event("infra_stop")

    try:
        generic_proxy.QUIET = True  # TODO: this doesn't seem to be doing anything
        LOG.debug("[shutdown] Cleaning up services ...")
        SERVICE_PLUGINS.stop_all_services()
        LOG.debug("[shutdown] Cleaning up resources ...")
        cleanup_resources()

        if config.FORCE_SHUTDOWN:
            LOG.debug(
                "[shutdown] Force shutdown, not waiting for infrastructure to shut down"
            )
            return

        LOG.debug("[shutdown] Waiting for infrastructure to shut down ...")
        wait_for_infra_shutdown()
        LOG.debug("[shutdown] Infrastructure is shut down")
    finally:
        events.infra_stopped.set()