summaryrefslogtreecommitdiff
path: root/lib/drb
AgeCommit message (Collapse)Author
2018-06-28Fix typo of file path [ci skip]a_matsuda
Patch by: yuuji.yaginuma <yuuji.yaginuma@gmail.com> https://github.com/ruby/ruby/pull/1900 [Fix GH-1900] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-19lib/drb/extservm.rb (service): do not return `false'normal
invoke_service_command may set entries in @servers to `false', making it incompatible with the intended use of the safe navigation operator. This caused occasional DRb test failures, but they were hidden with automatic retry. [ruby-core:87524] [Bug #14856] Fixes: r53111 ("use safe navigation operator") commit 059c9c1cf371e049c7481c78b76e9620da52757f [GH-1142] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17If host of URI is omitted, make it with IP address. seki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-30drb: use \A and \znobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-28`$SAFE` as a process global state. [Feature #14250]ko1
* vm_core.h (rb_vm_t): move `rb_execution_context_t::safe_level` to `rb_vm_t::safe_level_` because `$SAFE` is a process (VM) global state. * vm_core.h (rb_proc_t): remove `rb_proc_t::safe_level` because `Proc` objects don't need to keep `$SAFE` at the creation. Also make `is_from_method` and `is_lambda` as 1 bit fields. * cont.c (cont_restore_thread): no need to keep `$SAFE` for Continuation. * eval.c (ruby_cleanup): use `rb_set_safe_level_force()` instead of access `vm->safe_level_` directly. * eval_jump.c: End procs `END{}` doesn't keep `$SAFE`. * proc.c (proc_dup): removed and introduce `rb_proc_dup` in vm.c. * safe.c (rb_set_safe_level): don't check `$SAFE` 1 -> 0 changes. * safe.c (safe_setter): use `rb_set_safe_level()`. * thread.c (rb_thread_safe_level): `Thread#safe_level` returns `$SAFE`. It should be obsolete. * transcode.c (load_transcoder_entry): `rb_safe_level()` only returns 0 or 1 so that this check is not needed. * vm.c (vm_proc_create_from_captured): don't need to keep `$SAFE` for Proc. * vm.c (rb_proc_create): renamed to `proc_create`. * vm.c (rb_proc_dup): moved from proc.c. * vm.c (vm_invoke_proc): do not need to set and restore `$SAFE` for `Proc#call`. * vm_eval.c (rb_eval_cmd): rename a local variable to represent clearer meaning. * lib/drb/drb.rb: restore `$SAFE`. * lib/erb.rb: restore `$SAFE`, too. * test/lib/leakchecker.rb: check `$SAFE == 0` at the end of tests. * test/rubygems/test_gem.rb: do not set `$SAFE = 1`. * bootstraptest/test_proc.rb: catch up this change. * spec/ruby/optional/capi/string_spec.rb: ditto. * test/bigdecimal/test_bigdecimal.rb: ditto. * test/fiddle/test_func.rb: ditto. * test/fiddle/test_handle.rb: ditto. * test/net/imap/test_imap_response_parser.rb: ditto. * test/pathname/test_pathname.rb: ditto. * test/readline/test_readline.rb: ditto. * test/ruby/test_file.rb: ditto. * test/ruby/test_optimization.rb: ditto. * test/ruby/test_proc.rb: ditto. * test/ruby/test_require.rb: ditto. * test/ruby/test_thread.rb: ditto. * test/rubygems/test_gem_specification.rb: ditto. * test/test_tempfile.rb: ditto. * test/test_tmpdir.rb: ditto. * test/win32ole/test_win32ole.rb: ditto. * test/win32ole/test_win32ole_event.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-19Break out of the loop after shutdown in DRbServereregon
* Patch by @seki: https://gist.github.com/seki/ae8bef20238c37c94a91b5461c4bfbdd git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Avoid creating a Thread for shutting down a DRbServereregon
* lib/drb/drb.rb: avoid creating a Thread and call the shutdown logic directly. Do not try to kill or join the current Thread. Thread.new { stop_service } caused "can't alloc thread (ThreadError)", which is shown with Thread.report_on_exception = true. [Bug #14171] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add uplevel keyword to Kernel#warn and use itshyouhei
If uplevel keyword is given, the warning message is prepended with caller file and line information and the string "warning: ". The use of the uplevel keyword makes Kernel#warn format output similar to how rb_warn formats output. This patch modifies net/ftp and net/imap to use Kernel#warn instead of $stderr.puts or $stderr.printf, since they are used for printing warnings. This makes lib/cgi/core and tempfile use $stderr.puts instead of warn for debug logging, since they are used for debug printing and not for warning. This does not modify bundler, rubygems, or rdoc, as those are maintained outside of ruby and probably wish to remain backwards compatible with older ruby versions. rb_warn_m code is originally from nobu, but I've changed it so that it only includes the path and lineno from uplevel (not the method), and also prepends the string "warning: ", to make it more similar to rb_warn. From: Jeremy Evans code@jeremyevans.net Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Make ACL::ACLEntry not suppress IPAddr::InvalidPrefixErrorknu
This is because it would be a user error because a pattern containing a slash shouldn't be a host name pattern but an IP address pattern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08Remove unnecessary `require 'thread'`kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-07Use \A and \z to match whole stringnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-30Use qualified namesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22use finalizer trick instead of thread.seki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-15don't use keeper thread. [Bug #12342]seki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-28* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-28 * lib/drb/drb.rb (error_print): Add verbose failure messages andseki
avoid infamous DRb::DRbConnError. [Feature #12101] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-14* ext/socket/lib/socket.rb: use safe navigation operator.hsbt
[fix GH-1142] Patch by @mlarraz * lib/drb/extservm.rb: ditto. * lib/net/http.rb: ditto. * lib/net/http/response.rb: ditto. * lib/scanf.rb: ditto. * lib/uri/generic.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-10* lib/drb/drb.rb: revert r52442 because it was for debugging, and after thisusa
target problem was misteriously disappeared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-04* lib/drb/drb.rb: add debug information for mswin CI. this change will be ↵usa
reverted later. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27drb: avoid redundant fcntl callnormal
Sockets are close-on-exec by default since Ruby 2.0, so it is redundant to set it again. * lib/drb/drb.rb (set_sockopt): remove redundant fcntl call * lib/drb/unix.rb (set_sockopt): ditto [ruby-core:69128] [Feature #11137] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-06stdlib: use IO#wait_*able instead of IO.select when possiblenormal
In case a process encounters high-numbered FDs, this allows consistent performance on systems with ppoll support. [ruby-core:35572] * ext/socket/lib/socket.rb (connect_nonblock): use IO#wait_writable * lib/drb/drb.rb (DRB::DRbTCPSocket#alive?): use IO#wait_readable * lib/webrick/httpserver.rb (run): ditto * lib/resolv.rb (request): ditto for single socket case [ruby-core:68943] [Feature #11081] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-17drb.rb: do not wait handler threadsnobu
* lib/drb/drb.rb (stop_service): just stop but do not wait handler threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-17drb.rb: stop all handlers to fix thread leaksnobu
* lib/drb/drb.rb (stop_service): stop all handler threads started in main_loop. fix thread leaks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-04* lib/drb/drb.rb: removed unused argument. Patch by @vipulnswardhsbt
[fix GH-515] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-21* lib/drb/drb.rb: Support graceful shutdown.akr
(DRbTCPSocket#initialize): Create a pipe for shutdown notification. (DRbTCPSocket#close): Invoke close_shutdown_pipe. (DRbTCPSocket#close_shutdown_pipe): New private method. (DRbTCPSocket#accept): Use accept_or_shutdown. (DRbTCPSocket#accept_or_shutdown): New private method which returns nil on shutdown. (DRbServer#stop_service): Use shutdown instead of Thread#kill. (DRbServer#run): Break infinite loop when main_loop returns nil. (DRbServer#main_loop): @protocol.accept may return nil. * lib/drb/ssl.rb: Follow above change. * lib/drb/unix.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-27* lib/drb/acl.rb: Removed meaningless #to_s methods in interpolation.hsbt
[Feature #10174][ruby-core:64584] * lib/erb.rb: ditto. * lib/observer.rb: ditto. * lib/rake/invocation_chain.rb: ditto. * lib/rubygems/command_manager.rb: ditto. * lib/rubygems/config_file.rb: ditto. * lib/uri/common.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-27* lib/drb/drb.rb: use attr_reader instead of Module#attr.hsbt
[Feature #10172][ruby-core:64582] * lib/irb/ruby-token.rb: ditto. * lib/net/telnet.rb: ditto. * lib/rdoc/ruby_token.rb: ditto. * lib/thwait.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-21* lib/drb/acl.rb: split executable code into sample directory.hsbt
* sample/drb/acl.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-09* lib/cmath.rb: fixed indent.hsbt
* lib/drb/ssl.rb: ditto. * lib/irb/**/*.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-08* lib/drb/drb.rb: removed unreachable code.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-22* lib/drb/extserv.rb: remove duplicate code with sample direcotry.hsbt
contributed from @vipulnsward. [fix GH-679] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-31* lib/drb/drb.rb: [DOC] Add note about start_service for each processzzak
Based on a patch by @rosenfeld [Fixes GH-514] [ci skip] https://github.com/ruby/ruby/pull/514 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13* ext/socket/lib/socket.rb: Don't test $! in "ensure" clause becauseakr
it may be set before the body. Reported by ko1 and mrkn. [ruby-core:59088] [Bug #9247] * lib/cgi/core.rb: Ditto. * lib/drb/ssl.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29* lib/drb/ssl.rb: [DOC] Fix typoa_matsuda
s/currenly/currently/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-28* lib/drb/ssl.rb: [Doc] Fix typoa_matsuda
s/Confg/Config/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09* lib/drb/drb.rb: [DOC] promote better windows-safe filename regularzzak
expression in DRb Logger example. Reported by Chris Pheonix [Bug #9074] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-23* lib/drb/invokemethod.rb: [DOC] nodoc InvokeMethod18Mixinzzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-26* hash.c (rb_env_size): Restored documentation for ENV.sizedrbrain
* lib/drb/drb.rb: Documented DRb::DRb#run. * lib/erb.rb (class ERB): Improved documentation of ERb. * transcode.c: Documented Encoding::Converter constants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-25* lib/drb/drb.rb: Updated documentation based on patch from Vincentdrbrain
Batts. [ruby-trunk - Bug #7714] * lib/drb/ssl.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-25* lib/drb/drb.rb: Improved documentation by adding or hiding methods.drbrain
* lib/drb/eq.rb: ditto. * lib/drb/extserv.rb: ditto. * lib/drb/gw.rb: ditto. * lib/drb/invokemethod.rb: ditto. * lib/drb/observer.rb: ditto. * lib/drb/ssl.rb: ditto. * lib/drb/timeridconv.rb: ditto. * lib/drb/unix.rb: ditto. * sample/drb/gw_cu.rb: Fixed bug in DRb gateway sample. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-16* lib/cgi/core.rb: Use symbols instead of strings formarcandre
{const_,instance_variable_}{get,set}. [#7161] * lib/drb/drb.rb: ditto. * lib/ipaddr.rb: ditto. * lib/irb/workspace.rb: ditto. * lib/monitor.rb: ditto. * lib/rss/maker/base.rb: ditto. * lib/rss/rss.rb: ditto. * lib/xmlrpc/parser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-20* lib/drb/ssl.rb (DRb::DRbSSLSocket::SSLConfig::DEFAULT): addnaruse
SSLTmpDhCallback for configuration option. * lib/drb/ssl.rb (setup_ssl_context): copy the value of tmp_dh_callback. * test/drb/ut_array_drbssl.rb: set tmp_dh_callback to suppress warning. * test/drb/ut_drb_drbssl.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-21remove trainling spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-13* lib/drb/drb.rb: Replace broken links to the English DRb book.drbrain
Patch by Zachary Scott. [ruby-trunk - Bug #6544] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-13* lib/observer.rb: Update broken link to the Programming Ruby book.drbrain
Patch by Zachary Scott. [ruby-trunk - Bug #6536] * lib/drb/drb.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-23* lib/drb/ssl.rb: generate 1024 bits RSA key instead of 512 bits.akr
OpenSSL 1.0.1 rejects 512 bits RSA key for TLS1.2 with SHA512. http://rt.openssl.org/Ticket/Display.html?id=2769&user=guest&pass=guest reported by Bohuslav Kabrda. [ruby-core:43844] [ruby-trunk - Bug #6221] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-22* lib/drb/extservm.rb (DRb::ExtServManager): don't use /bin/sh toakr
invoke service subprocess. mark detach threads for clean up. * test/drb/drbtest.rb: clean up the service subprocess in teardown. * test/drb/test_drb.rb: set @service_name for teardown. * test/drb/test_drbunix.rb: ditto. * test/drb/test_drbssl.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-21* lib/drb/ssl.rb: close accepted TCP socket if SSL accept is failed.akr
[ruby-dev:45541] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e