…al deployment
Root-caused against a real cdk deploy, not from reading code alone:
- backend-service-stack.ts: ECS healthCheckGracePeriodSeconds silently
defaulted to 60s once an ALB target was attached, but the backend takes
~85s to finish booting (JVM + ADOT javaagent + Spring context). ECS killed
every task mid-boot before it could ever answer, crash-looping a perfectly
healthy application forever. Raised to 240s and made the ALB target-group
interval/thresholds explicit instead of relying on defaults.
- backend-service-stack.ts: MaxMetaspaceSize=192m was sized before the ADOT
javaagent was added; the extra instrumentation classes exhausted it under
real traffic (OutOfMemoryError: Metaspace), which took down the Redis/ES
health indicators and made /actuator/health report DOWN. Raised to 384m.
- backend-service-stack.ts: the container health check used CMD-SHELL, which
ECS runs through /bin/sh -- dash in eclipse-temurin:25-jre, which does not
implement /dev/tcp. The probe could never pass no matter how healthy the
app was. Verified directly against the real image (old form fails even
against a healthy server; fixed form passes/fails correctly). Switched to
CMD + explicit bash.
- UserServiceImpl.java: a new user's first page load fires several
authenticated requests in parallel (feed + /users/me at minimum); all find
no row and try to provision, and the losers trip users_cognito_sub_key.
provision() unconditionally blamed a username collision instead, 500ing a
legitimate sign-in. Now re-reads and returns the winner's row. Reproduced
live against the deployed stack, fixed, and covered by a new test.
- database-stack.ts: t4g -> t3 instance class (Graviton RDS capacity was
tighter than Intel in eu-central-1) plus a configurable multiAz flag.
- search-stack.ts: ECS health check retries capped at the real AWS limit
(10, was 20) with startPeriod raised to preserve intent; Elasticsearch
moved off PRIVATE_ISOLATED to PRIVATE_WITH_EGRESS so the Fargate task can
reach ECR/CloudWatch Logs before the container starts.
- compute-stack.ts, cache-stack.ts, event-streaming-stack.ts,
rtmp-service-stack.ts, ws-sfu-stack.ts: security-group description strings
fixed to the AWS-documented allowed charset (no em-dash, no bare ">").
- infra/bin/infra.ts: threads the new dbMultiAz context flag through.
- frontend/vite.config.ts: configurable VITE_CACHE_DIR so the dev server
does not fight write permissions on a shared cache path.
- .claude/launch.json: local dev-server launch config for the frontend.
Verified: full infra CDK suite green (26 suites / 89 tests), backend
UserServiceImplTest 4/4 including the new race test, and a real cdk deploy
of all 29 stacks reached CREATE_COMPLETE with the backend ALB target group
reporting healthy for the first time.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>