Skip to content

Increase content sanitizer timeout to 60s, add trackPoints - #89

Merged
wparad merged 2 commits into
mainfrom
claude/serializer-timeout-tracking-lpf7yr
Aug 25, 2026
Merged

Increase content sanitizer timeout to 60s, add trackPoints#89
wparad merged 2 commits into
mainfrom
claude/serializer-timeout-tracking-lpf7yr

Conversation

@wparad

@wparad wparad commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Raise content_sanitizer Lambda timeout from 10s to 60s (deploy/compute.tf)
  • Add logger.trackPoint() calls at every meaningful step of processEmail in src/isolated/content-sanitizer.ts (MIME fetch, MIME parse, attachment-limit validation, attachment processing/upload, HTML sanitization, link extraction from HTML/text, header extraction, asset extraction, response assembly)
  • Emit a TRACK log (content_sanitizer.slow_invocation) with the full trackPoints timeline whenever an invocation runs past 50s, mirroring the existing api.slow_request pattern in src/api/app.ts

Test plan

  • npx tsc --noEmit passes
  • npx eslint src/isolated/content-sanitizer.ts passes clean
  • npx vitest run tests/isolated/content-sanitizer-text-only.spec.ts tests/processor/content-sanitizer-client.spec.ts — 4/4 pass

Generated by Claude Code

claude added 2 commits August 25, 2026 20:19
Adds trackPoint() calls at each step of processEmail (MIME fetch, parse,
attachment validation/upload, HTML sanitization, link extraction, asset
extraction, response assembly) and emits a TRACK log with the full
trackPoints timeline when a content-sanitizer invocation runs past 50s,
mirroring the api.slow_request pattern used for the main lambda.
A finally block (or any code placed after "await work") never runs if
work hangs forever — the await itself never returns, so a genuinely stuck
invocation would silently run out the Lambda clock with no TRACK log at
all, the one case this logging exists to catch. Replace the post-await
elapsed check in both the content sanitizer and the api.slow_request
middleware with a setTimeout that fires independently at the threshold,
regardless of whether the awaited work ever settles.
@wparad
wparad merged commit 4594b06 into main Aug 25, 2026
6 checks passed
@wparad
wparad deleted the claude/serializer-timeout-tracking-lpf7yr branch August 25, 2026 20:33
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