-
Notifications
You must be signed in to change notification settings - Fork 420
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
Remove AtExit code #841
Remove AtExit code #841
Conversation
Following ruby-concurrency#840 which allowed all threads created by concurrent-ruby to be marked as daemon -- specifically in JRuby; the "AtExit" handling is no longer needed. Delete all references to "AtExit" and replace it with clearer documentation that the users can select whether the threads started shall be marked as daemon threads. > When a Java Virtual Machine starts up, there is usually a single non-daemon thread (which typically calls the method named main of some designated class). > The Java Virtual Machine continues to execute threads until either of the following occurs: > > 1. The exit method of class Runtime has been called and the security manager has permitted the exit operation to take place. > 2. All threads that are not daemon threads have died, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for following up! I've added few related cleanups into the PR.
b570725
to
138fe59
Compare
- disable_at_exit_handlers! has to be kept as noop not to break current usages - cleanup auto_terminate handling - remove ns_auto_terminate attribute - deprecate auto_terminate=
Add @LikeLakers2 suggestion. Co-Authored-By: MichiRecRoom <1008889+LikeLakers2@users.noreply.github.com>
Fix grammatical error in configuration.rb
Fix grammatical error in configuration.rb
138fe59
to
9800707
Compare
@pitr-ch looking the failures the builds are passing but not terminating. |
Sweet the Travis CI build passed with my latest commit @pitr-ch |
@@ -212,6 +212,8 @@ module Concurrent | |||
pid = spawn RbConfig.ruby, test_file | |||
Process.waitpid pid | |||
expect($?.success?).to eq true | |||
rescue Errno::ECHILD | |||
# child already gone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! I was also fixing this :)
rescue Errno::ECHILD
# the child could quit out fast enough before we try to wait for it!
I think we could TODO move this test to executor_service_shared
& have pool_quits
start every type of executor service: cached & single executor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that sounds like a good idea! Would you be willing to do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Failure does not seem related -- i re-triggered build with empty commit.
|
Thanks. I will remove the last commit and merge. (You can also trigger the build again by amending the last commit and force by force-pushing.) |
Just squash merge it @pitr-ch ? |
Yeah that works as well, I planned |
0230d44
to
c94b781
Compare
I just did that & it's using the previous failed check of that commit :( |
c94b781
to
40bd29a
Compare
Had to amend the HEAD commit anyways |
40bd29a
to
2c13ac6
Compare
Thanks for the PR Farid! |
thanks @pitr-ch |
Awesome, thanks for the offer 👍 This project definitely needs more contributors! This #796 deserves some attention. Let me know if that interests you and I will assign it to you. If not please have a look at https://github.com/ruby-concurrency/concurrent-ruby/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Alooking-for-contributor |
@pitr-ch on it. |
…e test helper.rb since it now has no effect, see ruby-concurrency/concurrent-ruby#841
* Add rubocop-minitest * Run bundle exec rubocop --only Minitest/GlobalExpectations -a * Revert rubocop-minitest * Manually fix unit test errors * Remove deprecated Concurrent.disable_at_exit_handlers! from acceptance test helper.rb since it now has no effect, see ruby-concurrency/concurrent-ruby#841 refs: #4110 refs: #4116 pr: #5654
Concurrent: [DEPRECATED] Method #disable_at_exit_handlers! has no effect since it is no longer needed, see ruby-concurrency/concurrent-ruby#841
Concurrent: [DEPRECATED] Method #disable_at_exit_handlers! has no effect since it is no longer needed, see ruby-concurrency/concurrent-ruby#841
Concurrent: [DEPRECATED] Method #disable_at_exit_handlers! has no effect since it is no longer needed, see ruby-concurrency/concurrent-ruby#841
Following #840 which allowed all threads created by concurrent-ruby
to be marked as daemon -- specifically in JRuby; the "AtExit" handling
is no longer needed.
Delete all references to "AtExit" and replace it with clearer
documentation that the users can select whether the threads started
shall be marked as daemon threads.
This would be considered a breaking change since the API surface is being modified.
I don't expect consumers of concurrent-ruby however to have used it. The reliance on the :auto-terminate option continues to work.
Conceptually, relying on the fact that threads are marked as daemon is much simpler & maps closer to the ExecutorService API which the library seems to model itself after (or the Java concurrent libraries in general).
Information regarding what it means to mark a thread as daemon: