def METHOD_NAME(marathon_clients, soa_dir):
    (
        desired_marathon_configs_formatted,
        desired_job_configs,
    ) = get_desired_marathon_configs(soa_dir)
    desired_ids_and_clients = set()
    for app_id, job_config in desired_job_configs.items():
        desired_ids_and_clients.add(
            (app_id, marathon_clients.get_current_client_for_service(job_config))
        )
    current_apps_with_clients = {
        (app.id.lstrip("/"), client): app
        for app, client in get_marathon_apps_with_clients(
            marathon_clients.get_all_clients()
        )
    }
    actual_ids_and_clients = set(current_apps_with_clients.keys())
    undesired_apps_and_clients = actual_ids_and_clients.symmetric_difference(
        desired_ids_and_clients
    )
    apps_that_need_bouncing = {
        long_job_id_to_short_job_id(app_id)
        for app_id, client in undesired_apps_and_clients
    }
    draining_hosts = get_draining_hosts()
    for (app_id, client), app in current_apps_with_clients.items():
        short_app_id = long_job_id_to_short_job_id(app_id)
        if short_app_id not in apps_that_need_bouncing:
            if (
                app.instances != desired_marathon_configs_formatted[app_id]["instances"]
                or get_num_at_risk_tasks(app, draining_hosts) != 0
            ):
                apps_that_need_bouncing.add(short_app_id)
    return (app_id.replace("--", "_") for app_id in apps_that_need_bouncing)