Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix deserialization issues in multi-threading environments #8651

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

wochinge
Copy link
Contributor

Related Issues

  • fixes #issue-number

Proposed Changes:

  • importing Python modules at the same time from different threads can lead to issues. We just spend multiple days debugging this. Change is adding a lock to avoid that multiple threads enter this at the same time. There is no impact for single-threaded applications

How did you test it?

  • covered by existing tests

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@wochinge wochinge requested review from a team as code owners December 17, 2024 12:34
@wochinge wochinge requested review from dfokina and Amnah199 and removed request for a team December 17, 2024 12:34
@github-actions github-actions bot added topic:core type:documentation Improvements on the docs labels Dec 17, 2024
@coveralls
Copy link
Collaborator

coveralls commented Dec 17, 2024

Pull Request Test Coverage Report for Build 12373296669

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 39 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.005%) to 90.485%

Files with Coverage Reduction New Missed Lines %
utils/type_serialization.py 7 89.04%
core/pipeline/base.py 32 88.64%
Totals Coverage Status
Change from base Build 12353137414: 0.005%
Covered Lines: 8112
Relevant Lines: 8965

💛 - Coveralls

@wochinge wochinge force-pushed the fix/pipeline-deserialization-multithreading branch from 74fa15d to 297c127 Compare December 17, 2024 12:45
Copy link
Member

@julian-risch julian-risch left a comment

Choose a reason for hiding this comment

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

LGTM!
Lock is immediately released if a ModuleNotFoundError is raised, so no additional error handling is needed.

@julian-risch julian-risch merged commit 91619a7 into main Dec 18, 2024
18 checks passed
@julian-risch julian-risch deleted the fix/pipeline-deserialization-multithreading branch December 18, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:core type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants