ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:40942] [ruby-trunk - Bug #5618][Open] Exceptions cause DRb connection to be closed
@ 2011-11-11 13:51 Lars Christensen
  2012-03-11  7:46 ` [ruby-core:43211] [ruby-trunk - Bug #5618] " Koichi Sasada
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lars Christensen @ 2011-11-11 13:51 UTC (permalink / raw)
  To: ruby-core


Issue #5618 has been reported by Lars Christensen.

----------------------------------------
Bug #5618: Exceptions cause DRb connection to be closed
http://redmine.ruby-lang.org/issues/5618

Author: Lars Christensen
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p0 (2011-10-30) [i386-mingw32]


If an exception is thrown in a DRb server of a class that is not defined in the client process, the DRb connection is closed abrubtly. In Ruby 1.8, the exception was translated to an instance generic exception class (DRb::DRbRemoteError).

Steps to reproduce:

1. Start DRb client+server
2. Throw exception of custom class in server (class not defined in client script).

Observed behaviour:

3. Client raises DRb::DRbConnError because connection is closed - used to be generic error.

Expected behaviour:

3. Client raises DRb::DRbRemoteError, and preserves full stack trace from server.

Attached is server/client script showing the problem.

Here is the stack trace of the client:

C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:570:in `load': connection closed (DRb::DRbConnError)
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:632:in `recv_reply'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:918:in `recv_reply'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1197:in `send_message'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1088:in `block (2 levels) in method_missing'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1172:in `open'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1087:in `block in method_missing'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1105:in `with_friend'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1086:in `method_missing'
        from drbclient.rb:3:in `<main>'


-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:43211] [ruby-trunk - Bug #5618] Exceptions cause DRb connection to be closed
  2011-11-11 13:51 [ruby-core:40942] [ruby-trunk - Bug #5618][Open] Exceptions cause DRb connection to be closed Lars Christensen
@ 2012-03-11  7:46 ` Koichi Sasada
  2015-02-01 16:01 ` [ruby-core:67933] " felix.buenemann
  2019-08-14 23:53 ` [ruby-core:94360] [Ruby master Bug#5618] " merch-redmine
  2 siblings, 0 replies; 4+ messages in thread
From: Koichi Sasada @ 2012-03-11  7:46 UTC (permalink / raw)
  To: ruby-core


Issue #5618 has been updated by Koichi Sasada.

Category set to lib
Assignee set to Masatoshi Seki


----------------------------------------
Bug #5618: Exceptions cause DRb connection to be closed
https://bugs.ruby-lang.org/issues/5618

Author: Lars Christensen
Status: Open
Priority: Normal
Assignee: Masatoshi Seki
Category: lib
Target version: 
ruby -v: ruby 1.9.3p0 (2011-10-30) [i386-mingw32]


If an exception is thrown in a DRb server of a class that is not defined in the client process, the DRb connection is closed abrubtly. In Ruby 1.8, the exception was translated to an instance generic exception class (DRb::DRbRemoteError).

Steps to reproduce:

1. Start DRb client+server
2. Throw exception of custom class in server (class not defined in client script).

Observed behaviour:

3. Client raises DRb::DRbConnError because connection is closed - used to be generic error.

Expected behaviour:

3. Client raises DRb::DRbRemoteError, and preserves full stack trace from server.

Attached is server/client script showing the problem.

Here is the stack trace of the client:

C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:570:in `load': connection closed (DRb::DRbConnError)
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:632:in `recv_reply'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:918:in `recv_reply'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1197:in `send_message'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1088:in `block (2 levels) in method_missing'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1172:in `open'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1087:in `block in method_missing'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1105:in `with_friend'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1086:in `method_missing'
        from drbclient.rb:3:in `<main>'


-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:67933] [ruby-trunk - Bug #5618] Exceptions cause DRb connection to be closed
  2011-11-11 13:51 [ruby-core:40942] [ruby-trunk - Bug #5618][Open] Exceptions cause DRb connection to be closed Lars Christensen
  2012-03-11  7:46 ` [ruby-core:43211] [ruby-trunk - Bug #5618] " Koichi Sasada
@ 2015-02-01 16:01 ` felix.buenemann
  2019-08-14 23:53 ` [ruby-core:94360] [Ruby master Bug#5618] " merch-redmine
  2 siblings, 0 replies; 4+ messages in thread
From: felix.buenemann @ 2015-02-01 16:01 UTC (permalink / raw)
  To: ruby-core

Issue #5618 has been updated by Felix Bünemann.


This issue still exists in Ruby 2.1.5.

----------------------------------------
Bug #5618: Exceptions cause DRb connection to be closed
https://bugs.ruby-lang.org/issues/5618#change-51325

* Author: Lars Christensen
* Status: Assigned
* Priority: Normal
* Assignee: Masatoshi Seki
* ruby -v: ruby 1.9.3p0 (2011-10-30) [i386-mingw32]
* Backport: 
----------------------------------------
If an exception is thrown in a DRb server of a class that is not defined in the client process, the DRb connection is closed abrubtly. In Ruby 1.8, the exception was translated to an instance generic exception class (DRb::DRbRemoteError).

Steps to reproduce:

1. Start DRb client+server
2. Throw exception of custom class in server (class not defined in client script).

Observed behaviour:

3. Client raises DRb::DRbConnError because connection is closed - used to be generic error.

Expected behaviour:

3. Client raises DRb::DRbRemoteError, and preserves full stack trace from server.

Attached is server/client script showing the problem.

Here is the stack trace of the client:

C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:570:in `load': connection closed (DRb::DRbConnError)
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:632:in `recv_reply'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:918:in `recv_reply'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1197:in `send_message'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1088:in `block (2 levels) in method_missing'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1172:in `open'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1087:in `block in method_missing'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1105:in `with_friend'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1086:in `method_missing'
        from drbclient.rb:3:in `<main>'

---Files--------------------------------
drbserver.rb (194 Bytes)
drbclient.rb (75 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:94360] [Ruby master Bug#5618] Exceptions cause DRb connection to be closed
  2011-11-11 13:51 [ruby-core:40942] [ruby-trunk - Bug #5618][Open] Exceptions cause DRb connection to be closed Lars Christensen
  2012-03-11  7:46 ` [ruby-core:43211] [ruby-trunk - Bug #5618] " Koichi Sasada
  2015-02-01 16:01 ` [ruby-core:67933] " felix.buenemann
@ 2019-08-14 23:53 ` merch-redmine
  2 siblings, 0 replies; 4+ messages in thread
From: merch-redmine @ 2019-08-14 23:53 UTC (permalink / raw)
  To: ruby-core

Issue #5618 has been updated by jeremyevans0 (Jeremy Evans).

File drb-rescue-exception-5618.patch added

This issue is unrelated to whether the client defines the same exception class as the server, and the behavior in my testing appears to be the same on 1.8 as in the master branch.

The underlying issue is that the example code here uses a subclass of `Exception`, and `DRb::DRbServer::InvokeMethod#perform` does not rescue `Exception`.  Attached is a patch that fixes this issue.

----------------------------------------
Bug #5618: Exceptions cause DRb connection to be closed
https://bugs.ruby-lang.org/issues/5618#change-80769

* Author: larsch (Lars Christensen)
* Status: Assigned
* Priority: Normal
* Assignee: seki (Masatoshi Seki)
* Target version: 
* ruby -v: ruby 1.9.3p0 (2011-10-30) [i386-mingw32]
* Backport: 
----------------------------------------
If an exception is thrown in a DRb server of a class that is not defined in the client process, the DRb connection is closed abrubtly. In Ruby 1.8, the exception was translated to an instance generic exception class (DRb::DRbRemoteError).

Steps to reproduce:

1. Start DRb client+server
2. Throw exception of custom class in server (class not defined in client script).

Observed behaviour:

3. Client raises DRb::DRbConnError because connection is closed - used to be generic error.

Expected behaviour:

3. Client raises DRb::DRbRemoteError, and preserves full stack trace from server.

Attached is server/client script showing the problem.

Here is the stack trace of the client:

C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:570:in `load': connection closed (DRb::DRbConnError)
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:632:in `recv_reply'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:918:in `recv_reply'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1197:in `send_message'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1088:in `block (2 levels) in method_missing'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1172:in `open'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1087:in `block in method_missing'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1105:in `with_friend'
        from C:/lang/Ruby193/lib/ruby/1.9.1/drb/drb.rb:1086:in `method_missing'
        from drbclient.rb:3:in `<main>'

---Files--------------------------------
drbserver.rb (194 Bytes)
drbclient.rb (75 Bytes)
drb-rescue-exception-5618.patch (1.03 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-14 23:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-11 13:51 [ruby-core:40942] [ruby-trunk - Bug #5618][Open] Exceptions cause DRb connection to be closed Lars Christensen
2012-03-11  7:46 ` [ruby-core:43211] [ruby-trunk - Bug #5618] " Koichi Sasada
2015-02-01 16:01 ` [ruby-core:67933] " felix.buenemann
2019-08-14 23:53 ` [ruby-core:94360] [Ruby master Bug#5618] " merch-redmine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).