Skip to content

fix(mlops): use spawn for feature ingestion - #6464

Open
lucasjia-aws wants to merge 1 commit into
aws:masterfrom
lucasjia-aws:fix/5312-feature-store-spawn
Open

lucasjia-aws wants to merge 1 commit into
aws:masterfrom
lucasjia-aws:fix/5312-feature-store-spawn

Conversation

@lucasjia-aws

@lucasjia-aws lucasjia-aws commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Feature Store pandas ingestion currently creates a multiprocessing pool with the platform default start method and defines its initializer inside the calling method. Fork mode can deadlock on recent macOS releases, while the nested initializer is not safe under spawn.

This change creates the pool from an explicit spawn context and moves the signal initializer to module scope so it can be pickled. Existing asynchronous result, close, and join behavior is preserved.

Testing

  • Added coverage for spawn-context selection, process count, initializer identity and behavior, asynchronous result retention, and pool cleanup.
  • Ran the complete affected Feature Store unit test file: 35 passed.
  • Black, Flake8, and git diff --check passed.
  • Built the sagemaker-mlops wheel and source distribution successfully.
  • No AWS integration tests or AWS calls were run.

Related change

The companion V2 fix is published on #6465.

Fixes #5312

Create the pandas ingestion pool from an explicit spawn context and move its signal initializer to module scope so it is picklable.

Add focused coverage for pool configuration and async cleanup.

Fixes aws#5312

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 AI code review

This PR switches Feature Store pandas multi-process ingestion from the platform-default multiprocessing start method to an explicit spawn context, and moves the SIGINT-ignoring worker initializer from a nested closure to module scope so it is picklable under spawn. This directly addresses the fork-based deadlock reported in #5312. The change is correct: the staticmethod target and module-level initializer are picklable, the pre-existing from multiprocessing import Pool import is still required (used as the type annotation at line 71), and wait()'s close/join behavior is preserved. Tests cover spawn-context selection, process count, initializer identity/behavior, and pool cleanup, and are consistent with the implementation. No issues found.

Reviewed commit 3a6c142. Automated review; verify before acting.

This branch was successfully deployed

1 active deployment
auto-approve — 3a6c1420 Deployed Oct 13, 2026 by lucasjia-aws via wait-for-approval #2026
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.

Feature Group ingest fork locking on Mac M1 Tahoe 26.0.1

1 participant