Skip to content

Use the configured region for deferred Neptune cluster tasks - #71646

Open
SEPURI-SAI-KRISHNA wants to merge 1 commit into
apache:mainfrom
SEPURI-SAI-KRISHNA:fix-neptune-trigger-region-name
Open

Use the configured region for deferred Neptune cluster tasks#71646
SEPURI-SAI-KRISHNA wants to merge 1 commit into
apache:mainfrom
SEPURI-SAI-KRISHNA:fix-neptune-trigger-region-name

Conversation

@SEPURI-SAI-KRISHNA

Copy link
Copy Markdown
Contributor

All three Neptune triggers declare a region_name parameter, document it, and read
self.region_name when building their hook — but never forward it to
AwsBaseWaiterTrigger.__init__, which is what actually assigns the attribute:

def __init__(self, *, db_cluster_id: str, ..., region_name: str | None = None, **kwargs):
    super().__init__(
        ...,
        aws_conn_id=aws_conn_id,
        # region_name never passed
        **kwargs,
    )

def hook(self) -> AwsGenericHook:
    return NeptuneHook(aws_conn_id=self.aws_conn_id, region_name=self.region_name, ...)

Because region_name is an explicit named parameter it is not swept up by the **kwargs
forwarding either — it is captured and discarded, so self.region_name is always None
and the deferred waiter polls the account's default region.

The failure is quiet and slow: the waiter simply never finds the cluster in the region it
is looking at, so the task burns through waiter_max_attempts and then fails with a
message that does not mention regions at all. AwsBaseWaiterTrigger.serialize() writes
self.region_name, so the wrong value also survives triggerer restarts.

There is a second, independent layer in the operators. Two of the four defer sites already
pass the hook configuration; the two in NeptuneStartDbClusterOperator.execute and
NeptuneStopDbClusterOperator.execute pass none of it, so fixing only the triggers would
still leave those paths on the default region. Both are brought in line with the existing
sites, which is why verify and botocore_config are included alongside region_name.

Affects NeptuneClusterAvailableTrigger, NeptuneClusterStoppedTrigger and
NeptuneClusterInstancesAvailableTrigger.

Tests cover both layers — that the triggers retain and serialize region_name, and that
the operators hand it to the trigger they defer with. All five fail without the change.

No newsfragment: this is a provider change, and provider changelogs are regenerated from
git log by the release manager.


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

Generated-by: Claude Code (Opus 5) following the guidelines

The triggers accepted a region_name but never handed it to the base trigger
  that assigns the attribute, and two of the operator defer sites never passed
  the hook configuration at all. A deferred start or stop therefore polled the
  default region, and the task failed only after exhausting its waiter attempts
  with an error that never mentioned the region.
@boring-cyborg boring-cyborg Bot added area:providers provider:amazon AWS/Amazon - related issues labels Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant