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

allow user to configure opt_handle_signals #333

Merged

Conversation

brian-dellabetta
Copy link
Contributor

@brian-dellabetta brian-dellabetta commented Jun 28, 2023

Hi @cjdoris , this PR is to allow a user to configure what is passed to julia --handle-signals=<yes,no>. I have just updated it to be in line with all the other CONFIG params, defaulting to no to retain backwards compatibility.

Following discussion thread starting here, I have found that this is much more robust and clean way to allow for multi-threaded julia code than my previous workaround.

Related to #219
Related to #298
Related to #330

@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Merging #333 (1421a06) into main (e374e25) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 1421a06 differs from pull request most recent head ebf8919. Consider uploading reports for the commit ebf8919 to get more accurate results

@@            Coverage Diff             @@
##             main     #333      +/-   ##
==========================================
- Coverage   41.50%   41.50%   -0.01%     
==========================================
  Files          76       76              
  Lines        4652     4653       +1     
==========================================
  Hits         1931     1931              
- Misses       2721     2722       +1     
Impacted Files Coverage Δ
pysrc/juliacall/__init__.py 71.22% <100.00%> (ø)

... and 1 file with indirect coverage changes

@cjdoris
Copy link
Collaborator

cjdoris commented Jul 4, 2023

Thank you. Could you also update the FAQ.md please with better advice for multithreading?

@brian-dellabetta brian-dellabetta force-pushed the feature/bd/handle-opt-signal-choice branch from 6385f91 to e9b7d18 Compare July 6, 2023 15:36
@brian-dellabetta
Copy link
Contributor Author

@cjdoris sure thing, just pushed and referenced the discussion thread.

@@ -129,7 +129,7 @@ def args_from_config():
CONFIG['opt_sysimage'] = sysimg = path_option('sysimage', check_exists=True)[0]
CONFIG['opt_threads'] = int_option('threads', accept_auto=True)[0]
CONFIG['opt_warn_overwrite'] = choice('warn_overwrite', ['yes', 'no'])[0]
CONFIG['opt_handle_signals'] = 'no'
CONFIG['opt_handle_signals'] = choice('handle_signals', ['yes', 'no'], default='no')[0]
Copy link

Choose a reason for hiding this comment

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

Can we default to yes? Defaulting to a behaviour which only causes crashes for backward compatibility doesn't seem very useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we default to yes? Defaulting to a behaviour which only causes crashes for backward compatibility doesn't seem very useful.

I agree, that's probably better to default to yes, but I left off for now as it is a behavioral change. Just posted a comment on this thread too, let's see what the author thinks

@brian-dellabetta
Copy link
Contributor Author

brian-dellabetta commented Jul 6, 2023

@cjdoris I also replied to corresponding issue here. I think users would want signal handling on by default, should we default to yes? It's a behavioral change from previous versions, but almost always wanted

@cjdoris cjdoris merged commit 5b90198 into JuliaPy:main Jul 23, 2023
@cjdoris
Copy link
Collaborator

cjdoris commented Jul 23, 2023

Thanks! Please open a separate issue/PR to change the default - AFAIR making it yes by default has undesirable side-effects on Python.

@brian-dellabetta brian-dellabetta deleted the feature/bd/handle-opt-signal-choice branch February 13, 2024 19:25
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