DO NOT MERGE: test dual-condition monitor with cache-only memory pressure#970
Conversation
Co-Authored-By: patrick.nilan@airbyte.io <patrick.nilan@airbyte.io>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1774888310-memory-failfast-feature-2#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1774888310-memory-failfast-feature-2PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
…-condition monitor Co-Authored-By: patrick.nilan@airbyte.io <patrick.nilan@airbyte.io>
|
/prerelease
|
…GBUS /dev/shm is a tmpfs with a hard size limit (typically 64 MB in Docker containers). After ~6 records at 10 MB each, the filesystem fills up and the next mm.write() triggers SIGBUS (exit code 135). Switching to /tmp (overlay fs) avoids the size limit. File-backed mmap pages on overlay fs still count toward cgroup memory and go into RssFile (not RssAnon), preserving the dual-condition test. Co-Authored-By: patrick.nilan@airbyte.io <patrick.nilan@airbyte.io>
This comment was marked as outdated.
This comment was marked as outdated.
…-memory-failfast-feature-2
|
/prerelease
|
|
DO NOT MERGE — test dual-condition monitor with cache-only memory pressure This branch creates file-backed mmap pages on Expected behavior: The memory monitor should detect high cgroup usage but low anonymous memory share, log "pressure likely from file-backed or reclaimable pages", and allow the connector to continue running normally. CDK dev version: |
This PR targets the following PR:
Summary
Adds a synthetic cache memory pressure scenario in
AirbyteEntrypoint.read()to test the negative case of the dual-condition memory monitor (introduced in #962). For each consumed record, a 10 MB file-backed mmap page is created on/tmp(overlay fs), which inflates cgroup memory usage without increasing the Python process's anonymous RSS (RssAnon).This validates that the memory monitor correctly does not raise
AirbyteTracedExceptionwhen container memory is high but the pressure comes from file-backed/reclaimable pages rather than process-private anonymous memory.DO NOT MERGE — test-only change to validate memory monitor behavior.
Companion PR: #969 (tests the positive case — process RSS growth triggers fail-fast)
Updates since last revision
/dev/shm(tmpfs) to/tmp(overlay fs) to fix SIGBUS (exit code 135). Docker containers typically cap/dev/shmat 64 MB, so after ~6 records the tmpfs filled up and the nextmm.write()triggered a bus error before the memory monitor ever got a chance to evaluate./tmpon overlay fs has no such hard limit, and file-backed mmap pages there still count toward cgroup memory asRssFile(notRssAnon), preserving the dual-condition test.Review & Testing Checklist for Human
/tmp(overlay fs) actually inflate cgroupmemory.currentin the target deployment environment — overlay fs page cache accounting can vary by kernel version and storage driverRssAnonin/proc/self/statusremains low relative to the container limitAirbyteTracedExceptionshutdownNotes
tempfile.mktemp(which has a theoretical race condition) rather thantempfile.mkstemp; acceptable for a throwaway test branch/tmp; memory growth rate depends on record throughputLink to Devin session: https://app.devin.ai/sessions/070ecb51ceee4f9189e1c09a83ba31cb