Skip to content

docs: clarify event block compute compatibility - #494

Merged
xyos merged 10 commits into
aws:mainfrom
ikenyal:docs/event-block-compute-compatibility
Nov 6, 2026
Merged

xyos merged 10 commits into
aws:mainfrom
ikenyal:docs/event-block-compute-compatibility

Conversation

@ikenyal

@ikenyal ikenyal commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Issue #, if available: N/A

The event-block documentation still describes a shared Lambda where each block actually uses its resolved compute. AsyncJob supports Lambda and container delivery after #574, and CronJob gained container delivery in #1113. The README, DESIGN, comparison tables, and public option comments need to describe those paths consistently.

Realtime is different: WebSocket handling still requires the default compute to be Lambda, rather than the compute resolved from a nearer scope.

Changes

  • Document Lambda and container delivery for AsyncJob and CronJob, including their different retry paths, local-mock limitations, execution timeouts, and queue visibility behavior.
  • Align CronJob's architecture diagram, compute-selection decision, runtime/infrastructure sections, and comparison/trade-off tables. Lambda jobs target the resolved function directly; container jobs use an internal AsyncJob runner's queue.
  • Describe Scheduler roles as backend-scoped, including separate roles for two backends in one stack and the union of target-specific Lambda invoke and SQS send grants.
  • Correct AsyncJob's options table, container introduction, and JSDoc: omitted compute inherits the nearest parent scope's compute, falling back to the backend default.
  • Remove the suggestion to omit maxConcurrencyPerCPU for CPU-bound work. Explicit values are multiplied by vCPU count; omission means five in-flight deliveries per job per instance. Clarify that the public types require an explicit container compute to configure this option, even when a parent scope uses a container.
  • Correct AsyncJob timeout comments to refer to the job's own timeoutSeconds, keep Realtime's default-Lambda requirement separate, and preserve the foreign-backend guards' descriptions.
  • Merge current main and refresh the patch changeset covering the three event-block packages and umbrella documentation.

No executable code, public API signatures, infrastructure configuration, or runnable examples change (apart from added error constants). This replaces the earlier Lambda-only CronJob wording now that #1113 has landed.

Validation

  • Rechecked all four review topics against CDK and runtime code, and searched the affected documents/comments for contradictory shared-Lambda, per-stack-role, compute-default, and concurrency descriptions.
  • A local CDK-only probe verified inherited container AsyncJobs/CronJobs, direct Lambda and queue Scheduler targets, target-specific permissions, repeated-function grant deduplication, and separate Scheduler roles for two backends in one stack. It also verified job timeout registration, cross-backend rejection, and unchanged 905-second queue visibility with a 60-second Lambda.
  • The probe verified that an explicit concurrency of one per vCPU on a two-vCPU compute registers two deliveries per instance, while omission registers no concurrency override. Separately checked the runtime fallback constant of five; no runtime default was changed.
  • TypeScript AST comparison confirms identical executable code and type syntax to main. Parsed runnable README/DESIGN examples are preserved except for added error constants.
  • npm run build
  • npm run lint and npm run lint:deps
  • npm test across all workspaces, with serial test-file execution and all four generate-client fixture cases run in separate processes; none excluded
  • npm run test:e2e:local, including comprehensive E2E, vendorize, IAM-boundary synth, and background-suite regression tests
  • API reports, conditional exports, packed assets, client user-agent consistency, runtime guards, documentation synchronization, and changeset guards/regression tests
  • git diff --check upstream/main

No repository tests were added because this PR changes only documentation and source comments. No AWS deployment was performed.

Checklist

  • PR description included
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ikenyal
ikenyal requested a review from a team as a code owner September 5, 2026 07:10
@changeset-bot

changeset-bot Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e8996d1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@aws-blocks/bb-async-job Patch
@aws-blocks/bb-cron-job Patch
@aws-blocks/bb-realtime Patch
@aws-blocks/blocks Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ikenyal
ikenyal force-pushed the docs/event-block-compute-compatibility branch from 15c8365 to 3858144 Compare October 12, 2026 08:35
@xyos

xyos commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Since this PR was opened, container-backed AsyncJobs landed in #574: the CDK layer accepts Lambda or container compute (packages/bb-async-job/src/index.cdk.ts:90-119), and the README documents the container path (packages/bb-async-job/README.md:65-95). The README text added here says AsyncJob "currently supports Lambda compute only". Could the wording distinguish the Lambda event-source path from the container path? packages/bb-async-job/DESIGN.md still describes a Lambda-only architecture (e.g. lines 6-7, 57-67) and may need the same update.

@ikenyal

ikenyal commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for catching this. I'd missed updating the AsyncJob wording for #574. The README and DESIGN.md now distinguish Lambda event-source delivery from the container poller/worker path, including visibility handling, execution timeouts, and local-mock differences. I also aligned the related public API comments. CronJob's resolved-Lambda constraint and Realtime's default-Lambda requirement remain separate.

I've also refreshed the PR description and rerun the build, lint, workspace unit tests, and local E2E; all pass. No runtime behavior changes.

Comment thread packages/bb-async-job/DESIGN.md Resolved
Comment thread packages/bb-cron-job/README.md Resolved
Comment thread packages/bb-async-job/DESIGN.md Resolved
Comment thread packages/bb-async-job/README.md Resolved

@xyos xyos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The follow-up commit fixes all four threads. The comparison tables, CronJob design, maxConcurrencyPerCPU default and compute inheritance wording now match the implementation. Thanks!

@xyos
xyos merged commit e8673cd into aws:main Nov 6, 2026
42 checks passed
harsh62 added a commit that referenced this pull request Nov 6, 2026
Brings in 14 commits from main, among them "fix(core): return Invalid
Request for a null JSON-RPC body" (#1143), "fix(core): reject non-JSON-RPC
response bodies with ApiError" (#1171), "feat(bb-logger,core): backend Lambda
log lines carry the invocation's requestId" (#1325), #1131, #1132, #1142,
#1167, #1173, #1178, #1214, #494 and CI changes (#946, #970, #971).

packages/core/src/client/index.test.ts and lambda-handler.test.ts: keep both
sides' tests (this branch's httpErrorStatus, namespace identity and per-call
fetch suites; main's non-JSON-RPC body and request id suites).

packages/core/src/api.ts: the httpErrorStatus docs now say what the client
does since #1171 when a Hosting error page replaces a 403 / 404: it rejects
with a bare ApiError carrying the HTTP status, instead of response.json()
throwing.

# Conflicts:
#	packages/core/src/client/index.test.ts
#	packages/core/src/lambda-handler.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants