Skip to content

Fix ConfigValue initialization in multithreaded environments#3405

Merged
blnicho merged 1 commit intoPyomo:mainfrom
jsiirola:config-init-threaded
Nov 7, 2024
Merged

Fix ConfigValue initialization in multithreaded environments#3405
blnicho merged 1 commit intoPyomo:mainfrom
jsiirola:config-init-threaded

Conversation

@jsiirola
Copy link
Copy Markdown
Member

@jsiirola jsiirola commented Nov 6, 2024

Fixes # .

Summary/Motivation:

After merging #3394 we started seeing random failures of a multithreading test under pypy. This PR resolves those failures by making the resolution of default Config (Value/List) values more thread safe.

Changes proposed in this PR:

  • Add a check to ensure that we only update an uninitialized ConfigValue / ConfigList __class__ once.

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.66%. Comparing base (c463632) to head (12a3e78).
Report is 384 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3405      +/-   ##
==========================================
+ Coverage   88.63%   88.66%   +0.03%     
==========================================
  Files         879      879              
  Lines      100363   100365       +2     
==========================================
+ Hits        88955    88992      +37     
+ Misses      11408    11373      -35     
Flag Coverage Δ
linux 86.12% <100.00%> (+<0.01%) ⬆️
osx 76.11% <100.00%> (+<0.01%) ⬆️
other 86.62% <100.00%> (+<0.01%) ⬆️
win 84.46% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blnicho blnicho merged commit 8e8280c into Pyomo:main Nov 7, 2024
@jsiirola jsiirola deleted the config-init-threaded branch November 15, 2024 03:21
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.

3 participants