You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Georg Franz (JIRA)" <ji...@apache.org> on 2012/10/01 10:51:07 UTC

[jira] [Created] (AVRO-1177) IPC interoperability problems with handshake

Georg Franz created AVRO-1177:
---------------------------------

             Summary: IPC interoperability problems with handshake
                 Key: AVRO-1177
                 URL: https://issues.apache.org/jira/browse/AVRO-1177
             Project: Avro
          Issue Type: Bug
          Components: ruby
    Affects Versions: 1.7.2
            Reporter: Georg Franz
         Attachments: avro_ruby_ipc.diff

I tried to get a simple echo service working using Java (client) to Ruby (server).

The service should be called repeatedly in a loop. I tried several things, but the best result I got was that it would work once, then raising this exception on the ruby side:

{noformat}lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:46:in `byte!': undefined method `unpack' for nil:NilClass (NoMethodError)
from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:63:in `read_long'
from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:380:in `read_union'
from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:316:in `read_data'
from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:391:in `block in read_record'
from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:389:in `each'
from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:389:in `read_record'
from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:317:in `read_data'
from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:282:in `read'
from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/ipc.rb:309:in `process_handshake'
from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/ipc.rb:253:in `respond'
{noformat}
On investigation, I found out that the ruby Responder expects a handshake on every request whereas the Java Requestor just sends a handshake the first time around.

I quickly hacked up Ruby support for multiple calls on the same connection similar to what the Java code does.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AVRO-1177) IPC interoperability problems with handshake

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-1177:
-------------------------------

    Fix Version/s: 1.7.3
           Status: Patch Available  (was: Open)

This passes existing tests for me.

Can someone familiar with Ruby please review it?

Unless someone objects, I'll commit this in a few days.
                
> IPC interoperability problems with handshake
> --------------------------------------------
>
>                 Key: AVRO-1177
>                 URL: https://issues.apache.org/jira/browse/AVRO-1177
>             Project: Avro
>          Issue Type: Bug
>          Components: ruby
>    Affects Versions: 1.7.2
>            Reporter: Georg Franz
>            Assignee: Georg Franz
>              Labels: patch
>             Fix For: 1.7.3
>
>         Attachments: avro_ruby_ipc.diff
>
>
> I tried to get a simple echo service working using Java (client) to Ruby (server).
> The service should be called repeatedly in a loop. I tried several things, but the best result I got was that it would work once, then raising this exception on the ruby side:
> {noformat}lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:46:in `byte!': undefined method `unpack' for nil:NilClass (NoMethodError)
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:63:in `read_long'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:380:in `read_union'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:316:in `read_data'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:391:in `block in read_record'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:389:in `each'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:389:in `read_record'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:317:in `read_data'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:282:in `read'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/ipc.rb:309:in `process_handshake'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/ipc.rb:253:in `respond'
> {noformat}
> On investigation, I found out that the ruby Responder expects a handshake on every request whereas the Java Requestor just sends a handshake the first time around.
> I quickly hacked up Ruby support for multiple calls on the same connection similar to what the Java code does.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AVRO-1177) IPC interoperability problems with handshake

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-1177:
-------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

I committed this.  Thanks, Georg!
                
> IPC interoperability problems with handshake
> --------------------------------------------
>
>                 Key: AVRO-1177
>                 URL: https://issues.apache.org/jira/browse/AVRO-1177
>             Project: Avro
>          Issue Type: Bug
>          Components: ruby
>    Affects Versions: 1.7.2
>            Reporter: Georg Franz
>            Assignee: Georg Franz
>              Labels: patch
>             Fix For: 1.7.3
>
>         Attachments: avro_ruby_ipc.diff
>
>
> I tried to get a simple echo service working using Java (client) to Ruby (server).
> The service should be called repeatedly in a loop. I tried several things, but the best result I got was that it would work once, then raising this exception on the ruby side:
> {noformat}lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:46:in `byte!': undefined method `unpack' for nil:NilClass (NoMethodError)
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:63:in `read_long'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:380:in `read_union'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:316:in `read_data'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:391:in `block in read_record'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:389:in `each'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:389:in `read_record'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:317:in `read_data'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:282:in `read'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/ipc.rb:309:in `process_handshake'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/ipc.rb:253:in `respond'
> {noformat}
> On investigation, I found out that the ruby Responder expects a handshake on every request whereas the Java Requestor just sends a handshake the first time around.
> I quickly hacked up Ruby support for multiple calls on the same connection similar to what the Java code does.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AVRO-1177) IPC interoperability problems with handshake

Posted by "Georg Franz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Georg Franz updated AVRO-1177:
------------------------------

    Attachment: avro_ruby_ipc.diff
    
> IPC interoperability problems with handshake
> --------------------------------------------
>
>                 Key: AVRO-1177
>                 URL: https://issues.apache.org/jira/browse/AVRO-1177
>             Project: Avro
>          Issue Type: Bug
>          Components: ruby
>    Affects Versions: 1.7.2
>            Reporter: Georg Franz
>              Labels: patch
>         Attachments: avro_ruby_ipc.diff
>
>
> I tried to get a simple echo service working using Java (client) to Ruby (server).
> The service should be called repeatedly in a loop. I tried several things, but the best result I got was that it would work once, then raising this exception on the ruby side:
> {noformat}lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:46:in `byte!': undefined method `unpack' for nil:NilClass (NoMethodError)
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:63:in `read_long'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:380:in `read_union'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:316:in `read_data'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:391:in `block in read_record'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:389:in `each'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:389:in `read_record'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:317:in `read_data'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:282:in `read'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/ipc.rb:309:in `process_handshake'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/ipc.rb:253:in `respond'
> {noformat}
> On investigation, I found out that the ruby Responder expects a handshake on every request whereas the Java Requestor just sends a handshake the first time around.
> I quickly hacked up Ruby support for multiple calls on the same connection similar to what the Java code does.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (AVRO-1177) IPC interoperability problems with handshake

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting reassigned AVRO-1177:
----------------------------------

    Assignee: Georg Franz
    
> IPC interoperability problems with handshake
> --------------------------------------------
>
>                 Key: AVRO-1177
>                 URL: https://issues.apache.org/jira/browse/AVRO-1177
>             Project: Avro
>          Issue Type: Bug
>          Components: ruby
>    Affects Versions: 1.7.2
>            Reporter: Georg Franz
>            Assignee: Georg Franz
>              Labels: patch
>         Attachments: avro_ruby_ipc.diff
>
>
> I tried to get a simple echo service working using Java (client) to Ruby (server).
> The service should be called repeatedly in a loop. I tried several things, but the best result I got was that it would work once, then raising this exception on the ruby side:
> {noformat}lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:46:in `byte!': undefined method `unpack' for nil:NilClass (NoMethodError)
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:63:in `read_long'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:380:in `read_union'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:316:in `read_data'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:391:in `block in read_record'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:389:in `each'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:389:in `read_record'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:317:in `read_data'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:282:in `read'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/ipc.rb:309:in `process_handshake'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/ipc.rb:253:in `respond'
> {noformat}
> On investigation, I found out that the ruby Responder expects a handshake on every request whereas the Java Requestor just sends a handshake the first time around.
> I quickly hacked up Ruby support for multiple calls on the same connection similar to what the Java code does.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1177) IPC interoperability problems with handshake

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470444#comment-13470444 ] 

Doug Cutting commented on AVRO-1177:
------------------------------------

The patch looks reasonable to me (not a Ruby hacker).

Note that this bug does not exist for http-based RPC, only for socket.  So using HTTP is a workaround.

It would be good to have a test for this bug.  The share/test/interop/bin/test_rpc_interop.sh currently makes HTTP-based RPC calls between Java, Ruby and Python, but it only makes one call per client and server instantiation.  So we could change the rpcsend and rpcreceive commands in Java, Ruby and Python to accept a parameter naming the number of times the client should send the request and the server should respond before exiting, and the Ruby and Python versions to accept 'avro:" uri's to indicate simple socket connections (Java already does this).  Finally, test_rpc_interop.sh would be changed to pass '2' for this parameter, to test that repeated requests are processed correctly, and to use "avro:" uris in addition to "http:" uris.  Phew!  That's a fair amount of work.
                
> IPC interoperability problems with handshake
> --------------------------------------------
>
>                 Key: AVRO-1177
>                 URL: https://issues.apache.org/jira/browse/AVRO-1177
>             Project: Avro
>          Issue Type: Bug
>          Components: ruby
>    Affects Versions: 1.7.2
>            Reporter: Georg Franz
>              Labels: patch
>         Attachments: avro_ruby_ipc.diff
>
>
> I tried to get a simple echo service working using Java (client) to Ruby (server).
> The service should be called repeatedly in a loop. I tried several things, but the best result I got was that it would work once, then raising this exception on the ruby side:
> {noformat}lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:46:in `byte!': undefined method `unpack' for nil:NilClass (NoMethodError)
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:63:in `read_long'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:380:in `read_union'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:316:in `read_data'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:391:in `block in read_record'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:389:in `each'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:389:in `read_record'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:317:in `read_data'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/io.rb:282:in `read'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/ipc.rb:309:in `process_handshake'
> from lib/ruby/gems/1.9.1/gems/avro-1.7.2/lib/avro/ipc.rb:253:in `respond'
> {noformat}
> On investigation, I found out that the ruby Responder expects a handshake on every request whereas the Java Requestor just sends a handshake the first time around.
> I quickly hacked up Ruby support for multiple calls on the same connection similar to what the Java code does.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira