aws-samples / aws-samples/sample-autonomous-cloud-coding-agents

fix(registry): align publish Lambda timeout with record creation polling budget

Open
#782 0 comments 0 reactions 0 assignees View on GitHub
bug infra-cdk registry
Dominant language
TypeScript
Stars
143
Forks
46
Avg merge
3d 9h
Merged PRs (30d)
20

Description

## Context

Follow-up from the final review of PR #779. This behavior predates the standalone Agent Registry migration.

## Problem

The registry publish Lambda has a 15-second timeout, while `waitPastCreating` can poll up to 30 times with a 2-second interval, for a nominal 60-second polling budget before SDK-call overhead.

A slow `CreateRegistryRecord` transition can therefore terminate the Lambda before the handler reaches its typed incomplete-publish error path, potentially leaving a DRAFT record that blocks a clean retry through the immutability check.

## Desired outcome

Make the execution budget internally consistent by either:

- Increasing the Lambda timeout to cover the full polling budget plus SDK and cleanup overhead, or
- Redesigning record creation waiting so it does not synchronously occupy the publish Lambda for the full transition.

Preserve actionable reporting for partially created records.

## Acceptance criteria

- The configured execution timeout safely exceeds the maximum synchronous polling duration, or synchronous polling is removed.
- Slow creation cannot terminate before the handler reports the partial record identifier and remediation guidance.
- Tests lock the timeout/poll-budget relationship or exercise the redesigned asynchronous path.
- Normal publish, submit, and optional approval behavior remains unchanged.

## References

- PR #779
- `cdk/src/handlers/shared/registry/agent-registry-client.ts`
- Registry publish Lambda definition in the CDK construct/stack

Contributor guide

Open the contributing guide

Research direction

Start with cdk/src/handlers/shared/registry/agent-registry-client.ts and the registry publish Lambda definition in the CDK construct or stack. Compare the 30-poll, 2-second waitPastCreating budget with the configured Lambda timeout, then inspect PR #779 for context. Done means slow creation cannot terminate before partial-record reporting, the relationship is covered by tests, and normal publish, submit, and approval behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.