You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Jeff Hammerbacher (JIRA)" <ji...@apache.org> on 2010/06/11 07:16:16 UTC

[jira] Created: (AVRO-573) Uncaught exceptions of an undeclared type are not handled correctly in Responder.java

Uncaught exceptions of an undeclared type are not handled correctly in Responder.java
-------------------------------------------------------------------------------------

                 Key: AVRO-573
                 URL: https://issues.apache.org/jira/browse/AVRO-573
             Project: Avro
          Issue Type: Bug
          Components: java
            Reporter: Jeff Hammerbacher


System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Jeff Hammerbacher commented on AVRO-573:
----------------------------------------

bq. I don't think a match=ERROR should be required to include the server's protocol or hash.

Yep that makes sense.

bq. We should probably specify a metadata key for an error message. Does that sound reasonable?

What would be the contents of the value portion?

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Jeff Hammerbacher
>             Fix For: 1.4.0
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Doug Cutting updated AVRO-573:
------------------------------

    Attachment: AVRO-573.patch

It seems that there were no tests for system errors in Java, and that they were broken.  I'm not sure what I was proposing earlier or why, but here's a patch that adds java tests for system errors and fixes the bugs detected.  With this applied, a remote system error is thrown locally as an AvroRuntimeException rather than an AvroRemoteException.

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java, spec
>            Reporter: Jeff Hammerbacher
>            Assignee: Doug Cutting
>             Fix For: 1.4.0
>
>         Attachments: AVRO-573.patch
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Doug Cutting commented on AVRO-573:
-----------------------------------

> What would be the contents of the value portion?

A system error message, in UTF-8.  So if for some reason the handshake process itself generates, e.g., a NullPointerException, you'll get a HandhakeResponse with match=ERROR and "avro.error.message" set in the response's metadata to "NullPointerException".  Make sense?

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Jeff Hammerbacher
>             Fix For: 1.4.0
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Jeff Hammerbacher commented on AVRO-573:
----------------------------------------

I'm not exactly sure what the correct behavior might be here; we may have blown up while processing the handshake, so we certainly don't want to try that again; should we just hardcode CLIENT as the match value?

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Jeff Hammerbacher
>             Fix For: 1.4.0
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Jeff Hammerbacher commented on AVRO-573:
----------------------------------------

Hey Doug,

I can confirm that this patch works nicely with the Python client currently in trunk. When throwing an unexpected error in the Java Responder, I get this error in my client:

{code}
avro.ipc.AvroRemoteException: org.apache.avro.AvroRuntimeException: Not in union ["string",{"type":"error","name":"AIOError","namespace":"org.apache.hadoop.hbase.avro.generated","fields":[{"name":"message","type":"string"}]}]: java.lang.NullPointerException
{code}

That looks correct to me. Great work!

Later,
Jeff

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java, spec
>            Reporter: Jeff Hammerbacher
>            Assignee: Doug Cutting
>             Fix For: 1.4.0
>
>         Attachments: AVRO-573.patch
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Doug Cutting updated AVRO-573:
------------------------------

    Status: Patch Available  (was: Open)

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java, spec
>            Reporter: Jeff Hammerbacher
>            Assignee: Doug Cutting
>             Fix For: 1.4.0
>
>         Attachments: AVRO-573.patch
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Doug Cutting updated AVRO-573:
------------------------------

    Component/s: spec

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java, spec
>            Reporter: Jeff Hammerbacher
>             Fix For: 1.4.0
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Doug Cutting commented on AVRO-573:
-----------------------------------

> blows away our old bbo. Our old bbo, however, had some useful stuff in it
> I did a quick glance at the patch and don't see any change to ipc/Responder.java,

That was changed in AVRO-578.

http://svn.apache.org/viewvc?view=revision&revision=958149

The handshake response data is now copied from the bbo before this, so this is no longer a potential problem.
There were several other problems handling system errors that the tests exposed that I fix in the patch.


> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java, spec
>            Reporter: Jeff Hammerbacher
>            Assignee: Doug Cutting
>             Fix For: 1.4.0
>
>         Attachments: AVRO-573.patch
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Jeff Hammerbacher commented on AVRO-573:
----------------------------------------

Doug,

The problem I turned up was in ipc/Responder.java, and was described by:

bq. Inside of the catch block where we handle system errors, however, I believe we're doing something bad: we're creating a new ByteBufferOutputStream bbo, which blows away our old bbo. Our old bbo, however, had some useful stuff in it that we've failed to recreate: the HandshakeResponse. Thus any client trying to read a system error appears SOL

I did a quick glance at the patch and don't see any change to ipc/Responder.java, so I'm not sure if the new tests (which are great!) are hitting the same problem I'm seeing above. I'll get out my test environment and see what I find.

Thanks,
Jeff

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java, spec
>            Reporter: Jeff Hammerbacher
>            Assignee: Doug Cutting
>             Fix For: 1.4.0
>
>         Attachments: AVRO-573.patch
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Jeff Hammerbacher commented on AVRO-573:
----------------------------------------

Hey Doug,

That sounds reasonable, but could you complete the description of the match=ERROR response? Should it be the same as CLIENT (e.g. give a server protocol and hash)?

Thanks,
Jeff

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Jeff Hammerbacher
>             Fix For: 1.4.0
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Doug Cutting commented on AVRO-573:
-----------------------------------

> So in the client we'd skip the server protocol and hash reading

Those are both already optional in the HandshakeResponse, so this should require no change.

> look for a specific metadata key

Only if you want to generate a pretty error message.

> and then bail on trying to read the message as well (since we don't have a protocol)?

This is in logic that's already handling each value of HandshakeResponse.match.  Some cases already don't read the message (match=NONE).  So that logic could add a new case to handle match=ERROR.  Or, if that logic already throws an error when the match type is unrecognized then it would not need to be changed at all, unless you want a more descriptive error to be thrown.

> Sounds okay-ish.

Do you have an alternate proposal or suggested improvements?



> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java, spec
>            Reporter: Jeff Hammerbacher
>            Assignee: Doug Cutting
>             Fix For: 1.4.0
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Doug Cutting commented on AVRO-573:
-----------------------------------

I don't think a match=ERROR should be required to include the server's protocol or hash.
Imagine a misconfigured server that cannot manage to locate its protocol for, e.g., a requested URL.
Ideally this might throw an HTTP error, but it might also result in an NPE within Avro.
It'd be nice if a client didn't hang or fail strangely in such cases.

We should probably specify a metadata key for an error message.  Does that sound reasonable?

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Jeff Hammerbacher
>             Fix For: 1.4.0
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Doug Cutting reassigned AVRO-573:
---------------------------------

    Assignee: Doug Cutting

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java, spec
>            Reporter: Jeff Hammerbacher
>            Assignee: Doug Cutting
>             Fix For: 1.4.0
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Doug Cutting updated AVRO-573:
------------------------------

          Status: Resolved  (was: Patch Available)
    Hadoop Flags: [Reviewed]
      Resolution: Fixed

I committed this.

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java, spec
>            Reporter: Jeff Hammerbacher
>            Assignee: Doug Cutting
>             Fix For: 1.4.0
>
>         Attachments: AVRO-573.patch
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-573) Uncaught exceptions of an undeclared type are not handled correctly in Responder.java

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

Jeff Hammerbacher commented on AVRO-573:
----------------------------------------

Let's say, for example, that I have an Avro implementation of an Avro protocol that is misbehaving slightly. One of the message implementations declares that it throws, for example, an AIOError, but during some processing in that message, a RuntimeException (say an NPE) gets thrown. Now, this has never happened in my code, because I statically compile future states of the universe before shipping. But hypothetically.

In ipc/Responder.java, on line 132, inside of the respond method, we entry a try/catch clause. Inside of this try/catch clause, we try calling whichever message is indicated by the request. If, in the body of that message, we throw an NPE, the catch clause will catch it and record the NPE as the "error" variable. Later, in line 149 of the same method, we have an if/else clause. We check to ensure the error is not null, and if it is not, we call writeError with the "error" variable as the object to be written. Since this object is of type NPE, which was not one of the errors declared by the message in the Avro protocol, we throw an error while trying to write the error, I think. Which is fine; we've now triggered a system error.

Inside of the catch block where we handle system errors, however, I believe we're doing something bad: we're creating a new ByteBufferOutputStream bbo, which blows away our old bbo. Our old bbo, however, had some useful stuff in it that we've failed to recreate: the HandshakeResponse. Thus any client trying to read a system error appears SOL

One thing I don't get, and I'm having trouble instrumenting to figure out why it is happening because I don't understand Maven, is that the logs write the "system error" twice; so somehow, for a single RPC, we're writing this system error log entry twice:

{noformat}
10/06/10 22:21:59 WARN ipc.Responder: system error
org.apache.avro.AvroRuntimeException: Not in union ["string",{"type":"error","name":"AIOError","namespace":"org.apache.hadoop.hbase.avro.generated","fields":[{"name":"message","type":"string"}]}]: java.lang.NullPointerException
	at org.apache.avro.generic.GenericData.resolveUnion(GenericData.java:340)
	at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:67)
	at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:55)
	at org.apache.avro.specific.SpecificResponder.writeError(SpecificResponder.java:81)
	at org.apache.avro.ipc.Responder.respond(Responder.java:137)
	at org.apache.avro.ipc.ResponderServlet.doPost(ResponderServlet.java:48)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
10/06/10 22:21:59 WARN ipc.Responder: system error
org.apache.avro.AvroRuntimeException: Not in union ["string",{"type":"error","name":"AIOError","namespace":"org.apache.hadoop.hbase.avro.generated","fields":[{"name":"message","type":"string"}]}]: java.lang.NullPointerException
	at org.apache.avro.generic.GenericData.resolveUnion(GenericData.java:340)
	at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:67)
	at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:55)
	at org.apache.avro.specific.SpecificResponder.writeError(SpecificResponder.java:81)
	at org.apache.avro.ipc.Responder.respond(Responder.java:137)
	at org.apache.avro.ipc.ResponderServlet.doPost(ResponderServlet.java:48)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
{noformat}

> Uncaught exceptions of an undeclared type are not handled correctly in Responder.java
> -------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Jeff Hammerbacher
>             Fix For: 1.4.0
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Doug Cutting commented on AVRO-573:
-----------------------------------

We probably need a match=ERROR in HandshakeResponse.  Arguably it's a back-compatible change, since it will cause applications to fail with an enum-out-of-bounds error rather than some other error.

Here's a proposal:
  - move the handshake to it's own try block.  in case of error, write a match=ERROR response
  - add mark() & reset() methods to ByteBufferOutputStream(), to save & restore its position
  - call bbo.mark() after the handshake response is written
  - call bbo.reset() in the catch clause before writing system error

How's that sound?


> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Jeff Hammerbacher
>             Fix For: 1.4.0
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Jeff Hammerbacher updated AVRO-573:
-----------------------------------

          Summary: Need to include Handshake Response when handling a system error on the Java server side  (was: Uncaught exceptions of an undeclared type are not handled correctly in Responder.java)
    Fix Version/s: 1.4.0

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Jeff Hammerbacher
>             Fix For: 1.4.0
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-573) Need to include Handshake Response when handling a system error on the Java server side

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

Jeff Hammerbacher commented on AVRO-573:
----------------------------------------

So in the client we'd skip the server protocol and hash reading, look for a specific metadata key, and then bail on trying to read the message as well (since we don't have a protocol)? Sounds okay-ish.

> Need to include Handshake Response when handling a system error on the Java server side
> ---------------------------------------------------------------------------------------
>
>                 Key: AVRO-573
>                 URL: https://issues.apache.org/jira/browse/AVRO-573
>             Project: Avro
>          Issue Type: Bug
>          Components: java, spec
>            Reporter: Jeff Hammerbacher
>            Assignee: Doug Cutting
>             Fix For: 1.4.0
>
>
> System error is not handling everything right now. Details in the comments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.