Skip to content

Add EmrServerlessStopSessionOperator to Amazon provider - #74870

Merged
vincbeck merged 1 commit into
apache:mainfrom
vgkowski:amazon-emr-serverless-stop-session
Oct 19, 2026
Merged

vincbeck merged 1 commit into
apache:mainfrom
vgkowski:amazon-emr-serverless-stop-session

Conversation

@vgkowski

Copy link
Copy Markdown
Contributor

Add EmrServerlessStopSessionOperator, which terminates an EMR Serverless interactive
(Spark Connect) session and can wait until it reaches TERMINATED.

Why:

  • Interactive sessions keep their Spark drivers and executors running until they are
    terminated or hit their idle timeout, so Dags need an explicit way to end a session
    once their work is done.

Changes:

  • The operator calls the TerminateSession boto3 API directly, after the same
    botocore >= 1.43.0 runtime check the other session operators use, so the provider's
    dependency floor is unchanged.
  • EmrServerlessStopSessionTrigger and the serverless_session_terminated waiter support
    synchronous and deferrable waiting. As in EmrServerlessStartSessionOperator,
    wait_for_completion decides whether the task waits and deferrable only picks how,
    and the trigger polls with the task's region, SSL verification and botocore settings.
  • Docs (howto section), a system-test example step, and unit tests.

This completes the interactive session lifecycle started in #70763 (start) and #70766
(get endpoint). It replaces #70768, which the stale bot closed before it was reviewed.


Was generative AI tooling used to co-author this PR?
  • Yes — Kiro (Claude Opus 5.5)

Generated-by: Kiro (Claude Opus 5.5) following the guidelines

Dags that start an EMR Serverless interactive session need a way to end
it as soon as their work is done rather than relying on the session's
idle timeout.

Stopping follows the same rules as starting: completion waiting decides
whether the task waits, deferrable mode only picks how it waits, and the
triggerer polls with the task's region, SSL verification and botocore
settings.
@vincbeck
vincbeck merged commit cae1728 into apache:main Oct 19, 2026
88 of 89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants