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(dispatcher): Fix pickle error on formula factory when using spawn method #285

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

gfieni
Copy link
Contributor

@gfieni gfieni commented Mar 18, 2024

This PR fixes a pickle error happening when the dispatcher actor is started using multiprocessing spawn method.

@gfieni gfieni added the bug Something isn't working label Mar 18, 2024
… method

When multiprocessing `spawn` method is used, serializing the formula factory
method with pickle (on process spawn) fails and the following exception is raised :

AttributeError: Can't pickle local object 'DispatcherActor._create_factory.<locals>.factory'

This is due to the usage of a local function as formula factory, which pickle cannot serialize.
@gfieni gfieni force-pushed the fix/spawn-dispatcher-pickle-error branch from 88e42e3 to f9b5807 Compare March 18, 2024 15:37
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 67.76%. Comparing base (d069837) to head (f9b5807).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #285      +/-   ##
==========================================
+ Coverage   67.63%   67.76%   +0.12%     
==========================================
  Files          72       72              
  Lines        3297     3279      -18     
==========================================
- Hits         2230     2222       -8     
+ Misses       1067     1057      -10     
Files Coverage Δ
src/powerapi/cli/binding_manager.py 72.60% <0.00%> (+4.65%) ⬆️
src/powerapi/dispatcher/dispatcher_actor.py 66.66% <57.14%> (+1.21%) ⬆️

@gfieni gfieni merged commit 4fdf318 into master Mar 18, 2024
8 of 9 checks passed
@gfieni gfieni deleted the fix/spawn-dispatcher-pickle-error branch March 18, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant