aboutsummaryrefslogtreecommitdiffstats
path: root/lib/drb
Commit message (Collapse)AuthorAgeFilesLines
* drb: close graceful shutdown pipe before socketnormal2018-08-252-0/+2
| | | | | | | | | Closing a listen socket while entering select(2) may trigger IOError or even deadlock because another thread may give the file descriptor to another file description; meaning the kernel can wait on the wrong description. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* drb: simplify shutdown pipe close logicnormal2018-08-251-9/+3
| | | | | | | IO#close is idempotent, so we don't need to waste bytecode to check or nil it at shutdown time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typo of file path [ci skip]a_matsuda2018-06-281-1/+1
| | | | | | | | | 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
* lib/drb/extservm.rb (service): do not return `false'normal2018-06-191-1/+1
| | | | | | | | | | | | | | | | 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
* If host of URI is omitted, make it with IP address. seki2018-03-171-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* drb: use \A and \znobu2017-12-303-8/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* `$SAFE` as a process global state. [Feature #14250]ko12017-12-281-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Break out of the loop after shutdown in DRbServereregon2017-12-191-1/+4
| | | | | | | * 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
* Avoid creating a Thread for shutting down a DRbServereregon2017-12-121-9/+14
| | | | | | | | | | * 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
* Add uplevel keyword to Kernel#warn and use itshyouhei2017-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make ACL::ACLEntry not suppress IPAddr::InvalidPrefixErrorknu2017-10-211-0/+7
| | | | | | | 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
* Remove unnecessary `require 'thread'`kazu2017-10-082-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use \A and \z to match whole stringnobu2017-04-071-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use qualified namesnobu2016-08-302-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2016-05-221-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use finalizer trick instead of thread.seki2016-05-221-21/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* don't use keeper thread. [Bug #12342]seki2016-05-151-23/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2016-02-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/drb/drb.rb (error_print): Add verbose failure messages andseki2016-02-281-7/+15
| | | | | | | | avoid infamous DRb::DRbConnError. [Feature #12101] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-1611-0/+11
| | | | | | 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
* * ext/socket/lib/socket.rb: use safe navigation operator.hsbt2015-12-141-1/+1
| | | | | | | | | | | [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
* * lib/drb/drb.rb: revert r52442 because it was for debugging, and after thisusa2015-11-101-1/+1
| | | | | | | target problem was misteriously disappeared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/drb/drb.rb: add debug information for mswin CI. this change will be ↵usa2015-11-041-1/+1
| | | | | | reverted later. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* drb: avoid redundant fcntl callnormal2015-05-272-3/+1
| | | | | | | | | | | 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
* stdlib: use IO#wait_*able instead of IO.select when possiblenormal2015-05-061-1/+2
| | | | | | | | | | | | | | 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
* drb.rb: do not wait handler threadsnobu2015-01-171-3/+2
| | | | | | | * 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
* drb.rb: stop all handlers to fix thread leaksnobu2015-01-171-2/+3
| | | | | | | * 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
* * lib/drb/drb.rb: removed unused argument. Patch by @vipulnswardhsbt2015-01-041-4/+4
| | | | | | [fix GH-515] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/drb/drb.rb: Support graceful shutdown.akr2014-09-213-7/+45
| | | | | | | | | | | | | | | | | | | | (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
* * lib/drb/acl.rb: Removed meaningless #to_s methods in interpolation.hsbt2014-08-271-1/+1
| | | | | | | | | | | | [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
* * lib/drb/drb.rb: use attr_reader instead of Module#attr.hsbt2014-08-271-1/+1
| | | | | | | | | | [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
* * lib/drb/acl.rb: split executable code into sample directory.hsbt2014-08-211-18/+0
| | | | | | * sample/drb/acl.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cmath.rb: fixed indent.hsbt2014-08-091-1/+1
| | | | | | | * 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
* * lib/drb/drb.rb: removed unreachable code.hsbt2014-08-081-10/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/drb/extserv.rb: remove duplicate code with sample direcotry.hsbt2014-07-221-30/+0
| | | | | | contributed from @vipulnsward. [fix GH-679] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/drb/drb.rb: [DOC] Add note about start_service for each processzzak2014-01-311-0/+3
| | | | | | | | 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
* * ext/socket/lib/socket.rb: Don't test $! in "ensure" clause becauseakr2013-12-131-2/+3
| | | | | | | | | | | | | 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
* * lib/drb/ssl.rb: [DOC] Fix typoa_matsuda2013-11-291-1/+1
| | | | | | s/currenly/currently/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/drb/ssl.rb: [Doc] Fix typoa_matsuda2013-11-281-1/+1
| | | | | | s/Confg/Config/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/drb/drb.rb: [DOC] promote better windows-safe filename regularzzak2013-11-091-1/+1
| | | | | | | | 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
* * lib/drb/invokemethod.rb: [DOC] nodoc InvokeMethod18Mixinzzak2013-07-231-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_env_size): Restored documentation for ENV.sizedrbrain2013-01-261-0/+4
| | | | | | | | | | | * 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
* * lib/drb/drb.rb: Updated documentation based on patch from Vincentdrbrain2013-01-252-19/+194
| | | | | | | | 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
* * lib/drb/drb.rb: Improved documentation by adding or hiding methods.drbrain2013-01-259-16/+109
| | | | | | | | | | | | | | | | * 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
* * lib/cgi/core.rb: Use symbols instead of strings formarcandre2012-11-161-2/+2
| | | | | | | | | | | | | | | | | | | | {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
* * lib/drb/ssl.rb (DRb::DRbSSLSocket::SSLConfig::DEFAULT): addnaruse2012-09-201-0/+2
| | | | | | | | | | | | 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
* remove trainling spaces.nobu2012-08-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/drb/drb.rb: Replace broken links to the English DRb book.drbrain2012-06-131-9/+3
| | | | | | | 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
* * lib/observer.rb: Update broken link to the Programming Ruby book.drbrain2012-06-131-1/+1
| | | | | | | | 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
* * lib/drb/ssl.rb: generate 1024 bits RSA key instead of 512 bits.akr2012-04-231-1/+1
| | | | | | | | | | 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