aboutsummaryrefslogtreecommitdiffstats
path: root/lib/drb
Commit message (Collapse)AuthorAgeFilesLines
* lib/drb/drb.rb: Prevent a "warning: assigned but unused variable"Yusuke Endoh2022-01-171-2/+2
| | | | ... by replacing the variable with a underscore-prefixed name
* to prevent collection, keep the last result.Masatoshi SEKI2022-01-151-0/+2
|
* clear `@result` after `setup_message`Koichi Sasada2022-01-141-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For the remote object `ro`, method chain like `ro.foo.bar` the result of `ro.foo` is stored in `@result`, but cleared just before `setup_message` and it seems GCed on specific machine. ``` 1) Error: DRbTests::TestDRbCore#test_05_eq: RangeError: "140" is recycled object (druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:366:in `_id2ref' (druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:366:in `to_obj' (druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1528:in `to_obj' (druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1847:in `to_obj' (druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:620:in `recv_request' (druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:931:in `recv_request' (druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1656:in `init_with_client' (druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1668:in `setup_message' (druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1632:in `perform' (druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1725:in `block (2 levels) in main_loop' (druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1721:in `loop' (druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1721:in `block in main_loop' /tmp/ruby/v3/src/trunk-repeat20-asserts/test/drb/drbtest.rb:206:in `test_05_eq' ``` To prevent collecting, clear `@result` just after `setup_message` and `setup_message` can get the last result object.
* [ruby/drb] Fix method names "regist" as "register"Nobuyoshi Nakada2021-12-272-4/+6
| | | | https://github.com/ruby/drb/commit/9a1ff286bc
* [ruby/drb] Bump up drb version to 2.1.0Hiroshi SHIBATA2021-10-141-1/+1
| | | | https://github.com/ruby/drb/commit/e4b7b68d67
* [ruby/drb] Bump up drb version to 2.0.5Hiroshi SHIBATA2021-10-141-1/+1
| | | | https://github.com/ruby/drb/commit/7edf67654c
* [ruby/drb] 6d890ec5979ec72586dd5f66dd8d33f7a9aefd1e was introduced to ↵Hiroshi SHIBATA2021-09-281-1/+1
| | | | | | support only Ruby 2.7+ https://github.com/ruby/drb/commit/bec410d184
* [ruby/drb] gemspec: Remove "executables" configurationOlle Jonsson2021-09-281-2/+0
| | | | | | This gem exposes 0 executables. https://github.com/ruby/drb/commit/ed4d0363e5
* Added ruby2_keywords for Ruby 2.5 and 2.6Hiroshi SHIBATA2021-01-181-0/+2
|
* [ruby/drb] Removed needless files from Gem::Specification#filesHiroshi SHIBATA2020-12-281-5/+18
| | | | https://github.com/ruby/drb/commit/61c49af71b
* Separate `send` into `public_send` and `__send__`Nobuyoshi Nakada2020-10-271-1/+1
|
* Promote drb to the default gemsHiroshi SHIBATA2020-10-142-0/+33
|
* Removed DRb.default_safe_level and DRb#safe_levelHiroshi SHIBATA2020-09-111-9/+0
|
* Avoid deprecated OpenSSL::Digest constantsBart de Water2020-06-291-1/+1
|
* lib/drb/drb.rb: Use ruby2_keywords for keyword separationYusuke Endoh2020-02-151-1/+1
| | | | [Bug #16634]
* Stop Thread.new in `DRb::TimerIdConv::TimerHolder2#on_gc`Kazuhiro NISHIYAMA2019-12-101-0/+1
| | | | and add more stop_pool after stop_service
* Do not start thread when `require 'drb/drb'` onlyKazuhiro NISHIYAMA2019-12-061-1/+1
|
* lib/drb/drb.rb: suppress warning: instance variable @pool_proxy not initializedYusuke Endoh2019-12-051-0/+1
|
* Fix thread leak in drbKazuhiro NISHIYAMA2019-12-041-2/+10
|
* Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans2019-11-183-16/+1
| | | | | | This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby.
* Warn on access/modify of $SAFE, and remove effects of modifying $SAFEJeremy Evans2019-11-181-52/+10
| | | | | | | | | | | | | | | | | This removes the security features added by $SAFE = 1, and warns for access or modification of $SAFE from Ruby-level, as well as warning when calling all public C functions related to $SAFE. This modifies some internal functions that took a safe level argument to no longer take the argument. rb_require_safe now warns, rb_require_string has been added as a version that takes a VALUE and does not warn. One public C function that still takes a safe level argument and that this doesn't warn for is rb_eval_cmd. We may want to consider adding an alternative method that does not take a safe level argument, and warn for rb_eval_cmd.
* Fix DRbServer#any_to_sJeremy Evans2019-10-161-8/+2
| | | | | | | | My previous fix in d0ed935d5bf8c3fce9800742a36e44fb7f63dda4 was not correct, as pointed out by cremno on GitHub. This simplifies things by just using Kernel#to_s. Also switch to bind_call(obj) instead of bind(obj).call for better performance.
* Do not raise an exception on a closed DRb socketJeremy Evans2019-10-161-0/+2
| | | | | | | | | This rescues some exceptions that could happen with a closed or shutdown DRb socket. This can prevent the server from exiting if an client socket is closed directly after it is accepted. Fixes [Bug #8039]
* Handle subclasses of Exception in drbJeremy Evans2019-10-161-1/+3
| | | | | | | | | | | This makes it so that client instances that call a method on a server-side object that raise a subclass of Exception are handled similarly to those that raise a subclass of StandardError. Only reraise exceptions that we are fairly sure we don't want to rescue. Fixes [Bug #5618]
* add require "monitor"Masatoshi SEKI2019-10-141-0/+1
|
* Automatically close fds on fork (and GC). The connection pools are ↵Masatoshi SEKI2019-10-141-24/+76
| | | | maintained at thread scope.
* Fix some DRb issues (#2552)Jeremy Evans2019-10-141-17/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Handle BasicObject in drb Also fix a bug in rescue clause of any_to_s because sprintf does not handle the %l modifier. Fixes [Bug #7833] * Do not send a reply to the client if there is a connection error This allows for normal TCP shutdown (fin-ack-fin-ack instead of fin-ack-push-rst). Patch from pierre@mouraf.org (Pierre-Alexandre Meyer). Fixes [Bug #2339] * Detect fork and do not reuse forked connections in drb This associates each DRbConn with a pid, and if the pid changes, it closes any DRbConns in the pool with a pid that no longer matches. This fixes DRb servers from sending messages intended for one client to another client after forking. Fixes [Bug #2718] Fixes [Bug #14471]
* change default value of load_limit (ignore load_limit)Masatoshi SEKI2019-07-131-1/+1
|
* * remove trailing spaces.git2019-05-041-2/+2
|
* add DRb::WeakIdConv (Bug #15711)Masatoshi SEKI2019-05-041-0/+59
|
* drb: fix tests on Debian sid/unstable with OpenSSL 1.1.1anormal2018-12-031-2/+2
| | | | | | | OpenSSL complains abour our keys being small and weak :< Make them big and strong with 2048-bit RSA keys and SHA256 digests git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix up r65505 [ci skip]kazu2018-11-051-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/*: Prefer require_relative over require.marcandre2018-11-027-11/+11
| | | | | | [#15206] [Fix GH-1976] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Revert "Reset primary_server when remove_server"" [ci skip]kazu2018-10-201-0/+5
| | | | | | | | This reverts commit d2671c96f32e6fbbd39162a2c9042dcaf3bf2d68. previous reverting is commit miss git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Allow to stop by push(nil) for testkazu2018-10-201-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Reset primary_server when remove_server"kazu2018-10-201-5/+0
| | | | | | This reverts commit 2948d3bd2e78b5b9110454a7135a81c3fecb2575. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Reset primary_server when remove_serverkazu2018-10-201-0/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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