[ 
https://issues.apache.org/jira/browse/AVRO-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16894056#comment-16894056
 ] 

Lee Hambley commented on AVRO-538:
----------------------------------

This issue is still present in the 1.9.0 and 1.8.2 gems, here are the error 
traces for those versions respectively.

Ruby Gem 1.9.0

{{Traceback (most recent call last):}}
{{        11: from ./client.rb:68:in `<main>'}}
{{        10: from ./client.rb:30:in `geocode'}}
{{         9: from ./client.rb:35:in `request'}}
{{         8: from /usr/share/gems/gems/avro-1.9.0/lib/avro/ipc.rb:115:in 
`request'}}
{{         7: from /usr/share/gems/gems/avro-1.9.0/lib/avro/ipc.rb:218:in 
`read_call_response'}}
{{         6: from /usr/share/gems/gems/avro-1.9.0/lib/avro/ipc.rb:229:in 
`read_error'}}
{{         5: from /usr/share/gems/gems/avro-1.9.0/lib/avro/io.rb:252:in 
`read'}}
{{         4: from /usr/share/gems/gems/avro-1.9.0/lib/avro/io.rb:286:in 
`read_data'}}
{{         3: from /usr/share/gems/gems/avro-1.9.0/lib/avro/io.rb:352:in 
`read_union'}}
{{         2: from /usr/share/gems/gems/avro-1.9.0/lib/avro/io.rb:63:in 
`read_long'}}
{{         1: from /usr/share/gems/gems/avro-1.9.0/lib/avro/io.rb:46:in 
`byte!'}}
{{/usr/share/gems/gems/avro-1.9.0/lib/avro/io.rb:46:in `readbyte': end of file 
reached (EOFError)}}

Ruby Gem 1.8.2

{{Traceback (most recent call last):}}
{{        10: from ./client.rb:68:in `<main>'}}
{{         9: from ./client.rb:30:in `geocode'}}
{{         8: from ./client.rb:35:in `request'}}
{{         7: from .bundle/ruby/2.6.0/gems/avro-1.8.2/lib/avro/ipc.rb:115:in 
`request'}}
{{         6: from .bundle/ruby/2.6.0/gems/avro-1.8.2/lib/avro/ipc.rb:218:in 
`read_call_response'}}
{{         5: from .bundle/ruby/2.6.0/gems/avro-1.8.2/lib/avro/ipc.rb:229:in 
`read_error'}}
{{         4: from .bundle/ruby/2.6.0/gems/avro-1.8.2/lib/avro/io.rb:275:in 
`read'}}
{{         3: from .bundle/ruby/2.6.0/gems/avro-1.8.2/lib/avro/io.rb:309:in 
`read_data'}}
{{         2: from .bundle/ruby/2.6.0/gems/avro-1.8.2/lib/avro/io.rb:373:in 
`read_union'}}
{{         1: from .bundle/ruby/2.6.0/gems/avro-1.8.2/lib/avro/io.rb:63:in 
`read_long'}}
{{.bundle/ruby/2.6.0/gems/avro-1.8.2/lib/avro/io.rb:46:in `byte!': undefined 
method `unpack' for nil:NilClass (NoMethodError)}}

It is my best-guess that the issue stems from a single byte and only a single 
byte being written by the Responder, all the stack traces lead to places where 
the Ruby gem is reaching into the BinaryDecoder which has (seems to have) no 
more bytes available.

 

The code paths in the original report (1.4.0), 1.8.2 and 1.9.0 are all 
extremely similar.

> No way to raise errors in a Ruby IPC server such that they get returned as an 
> avro error type
> ---------------------------------------------------------------------------------------------
>
>                 Key: AVRO-538
>                 URL: https://issues.apache.org/jira/browse/AVRO-538
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: ruby
>    Affects Versions: 1.4.0
>         Environment: Mac OS X
>            Reporter: Rael Dornfest
>            Priority: Major
>
> Raising an AvroError or even a subclass thereof doesn't simply return a nice 
> clean Error to the client despite errors being specified in the schema.
> Instead, the client sees:
> .../lib/ruby/gems/1.8/gems/avro-1.4.0.pre1/lib/avro/io.rb:46:in `byte!': 
> undefined method `[]' for nil:NilClass (NoMethodError)
> .../lib/ruby/gems/1.8/gems/avro-1.4.0.pre1/lib/avro/io.rb:63:in `read_long'
> .../lib/ruby/gems/1.8/gems/avro-1.4.0.pre1/lib/avro/io.rb:379:in `read_union'
> .../lib/ruby/gems/1.8/gems/avro-1.4.0.pre1/lib/avro/io.rb:315:in `read_data'
> .../lib/ruby/gems/1.8/gems/avro-1.4.0.pre1/lib/avro/io.rb:281:in `read'
> .../lib/ruby/gems/1.8/gems/avro-1.4.0.pre1/lib/avro/ipc.rb:224:in `read_error'
> .../lib/ruby/gems/1.8/gems/avro-1.4.0.pre1/lib/avro/ipc.rb:213:in 
> `read_call_response'
> .../lib/ruby/gems/1.8/gems/avro-1.4.0.pre1/lib/avro/ipc.rb:113:in `request'



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to