You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Stephen Gargan (JIRA)" <ji...@apache.org> on 2011/01/02 03:59:46 UTC

[jira] Created: (AVRO-723) Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder

Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder
-------------------------------------------------------------------------

                 Key: AVRO-723
                 URL: https://issues.apache.org/jira/browse/AVRO-723
             Project: Avro
          Issue Type: Bug
          Components: java
    Affects Versions: 1.5.0
            Reporter: Stephen Gargan
            Priority: Minor


Undeclared errors thrown during service invocations are not getting returned correctly. When they are encountered, the writeError method in the responder will try to encode them using errors union for the message. However, because they are undeclared they are not present in the union and encoding causes a further AvroRuntimeException. Its this "Not in union" exception that gets returned to the client, not the undeclared problem which gets lost.

The attached patch handles them like other system errors, calling to string on the exception and writing this as the error to be returned.

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


[jira] Updated: (AVRO-723) Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder

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

Doug Cutting updated AVRO-723:
------------------------------

    Attachment: AVRO-723.patch

Here's a new version of the patch where the exception is caught in the Responder base class rather than both in SpecificResponder and GenericResponder.  I also removed some spurious changes to imports present in your patch.

If this looks reasonable, I'll commit it.


> Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder
> -------------------------------------------------------------------------
>
>                 Key: AVRO-723
>                 URL: https://issues.apache.org/jira/browse/AVRO-723
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.5.0
>            Reporter: Stephen Gargan
>            Priority: Minor
>             Fix For: 1.5.0
>
>         Attachments: AVRO-723.patch, undeclared-error.patch, undeclared-error.patch, undeclared-error.patch
>
>
> Undeclared errors thrown during service invocations are not getting returned correctly. When they are encountered, the writeError method in the responder will try to encode them using errors union for the message. However, because they are undeclared they are not present in the union and encoding causes a further AvroRuntimeException. Its this "Not in union" exception that gets returned to the client, not the undeclared problem which gets lost.
> The attached patch handles them like other system errors, calling to string on the exception and writing this as the error to be returned.

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


[jira] Updated: (AVRO-723) Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder

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

Stephen Gargan updated AVRO-723:
--------------------------------

    Attachment: undeclared-error.patch

Doug,

It is pretty brittle alright. I've made the changes as you suggested. 

HTH

Steve. 

> Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder
> -------------------------------------------------------------------------
>
>                 Key: AVRO-723
>                 URL: https://issues.apache.org/jira/browse/AVRO-723
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.5.0
>            Reporter: Stephen Gargan
>            Priority: Minor
>         Attachments: undeclared-error.patch, undeclared-error.patch, undeclared-error.patch
>
>
> Undeclared errors thrown during service invocations are not getting returned correctly. When they are encountered, the writeError method in the responder will try to encode them using errors union for the message. However, because they are undeclared they are not present in the union and encoding causes a further AvroRuntimeException. Its this "Not in union" exception that gets returned to the client, not the undeclared problem which gets lost.
> The attached patch handles them like other system errors, calling to string on the exception and writing this as the error to be returned.

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


[jira] Commented: (AVRO-723) Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder

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

Doug Cutting commented on AVRO-723:
-----------------------------------

Matching the error string seems fragile.  Perhaps we should:
 - add a new exception, UnresolvedUnion that includes the datum
 - change GenericData#resolveUnion to throw UnresolvedUnion
 - change Responder#respond to catch UnresolvedUnion when calling writeError and rethrow the datum

This would cause the original error message to be sent.  Does that sound reasonable?

> Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder
> -------------------------------------------------------------------------
>
>                 Key: AVRO-723
>                 URL: https://issues.apache.org/jira/browse/AVRO-723
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.5.0
>            Reporter: Stephen Gargan
>            Priority: Minor
>         Attachments: undeclared-error.patch, undeclared-error.patch
>
>
> Undeclared errors thrown during service invocations are not getting returned correctly. When they are encountered, the writeError method in the responder will try to encode them using errors union for the message. However, because they are undeclared they are not present in the union and encoding causes a further AvroRuntimeException. Its this "Not in union" exception that gets returned to the client, not the undeclared problem which gets lost.
> The attached patch handles them like other system errors, calling to string on the exception and writing this as the error to be returned.

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


[jira] Updated: (AVRO-723) Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder

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

Stephen Gargan updated AVRO-723:
--------------------------------

    Attachment: undeclared-error.patch

Philip,

Yes, I guess if the error was defined the write could fail in other ways; it should be specific to the 'Not in union' case. The attached patch checks just for this. 

Thanks,

Steve.

> Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder
> -------------------------------------------------------------------------
>
>                 Key: AVRO-723
>                 URL: https://issues.apache.org/jira/browse/AVRO-723
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.5.0
>            Reporter: Stephen Gargan
>            Priority: Minor
>         Attachments: undeclared-error.patch, undeclared-error.patch
>
>
> Undeclared errors thrown during service invocations are not getting returned correctly. When they are encountered, the writeError method in the responder will try to encode them using errors union for the message. However, because they are undeclared they are not present in the union and encoding causes a further AvroRuntimeException. Its this "Not in union" exception that gets returned to the client, not the undeclared problem which gets lost.
> The attached patch handles them like other system errors, calling to string on the exception and writing this as the error to be returned.

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


[jira] Commented: (AVRO-723) Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder

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

Doug Cutting commented on AVRO-723:
-----------------------------------

Also, the testUndeclaredError test in TestProtocolGeneric, TestProtocolSpecific and TestProtocolReflect should be updated to check that the error message contains the original error message.

> Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder
> -------------------------------------------------------------------------
>
>                 Key: AVRO-723
>                 URL: https://issues.apache.org/jira/browse/AVRO-723
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.5.0
>            Reporter: Stephen Gargan
>            Priority: Minor
>         Attachments: undeclared-error.patch, undeclared-error.patch
>
>
> Undeclared errors thrown during service invocations are not getting returned correctly. When they are encountered, the writeError method in the responder will try to encode them using errors union for the message. However, because they are undeclared they are not present in the union and encoding causes a further AvroRuntimeException. Its this "Not in union" exception that gets returned to the client, not the undeclared problem which gets lost.
> The attached patch handles them like other system errors, calling to string on the exception and writing this as the error to be returned.

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


[jira] Commented: (AVRO-723) Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder

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

Stephen Gargan commented on AVRO-723:
-------------------------------------

Looks great to me. Thanks Doug.

> Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder
> -------------------------------------------------------------------------
>
>                 Key: AVRO-723
>                 URL: https://issues.apache.org/jira/browse/AVRO-723
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.5.0
>            Reporter: Stephen Gargan
>            Assignee: Stephen Gargan
>            Priority: Minor
>             Fix For: 1.5.0
>
>         Attachments: AVRO-723.patch, undeclared-error.patch, undeclared-error.patch, undeclared-error.patch
>
>
> Undeclared errors thrown during service invocations are not getting returned correctly. When they are encountered, the writeError method in the responder will try to encode them using errors union for the message. However, because they are undeclared they are not present in the union and encoding causes a further AvroRuntimeException. Its this "Not in union" exception that gets returned to the client, not the undeclared problem which gets lost.
> The attached patch handles them like other system errors, calling to string on the exception and writing this as the error to be returned.

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


[jira] Commented: (AVRO-723) Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder

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

Philip Zeyliger commented on AVRO-723:
--------------------------------------

Hi Stephen,

I think this is an improvement.  I'm a bit worried about catching the AvroRuntimeException but, then ignoring it.  Could the AvroRuntimeException actually be something other than the schema mismatch from an undeclared error?  If so, that error would get swallowed. 

> Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder
> -------------------------------------------------------------------------
>
>                 Key: AVRO-723
>                 URL: https://issues.apache.org/jira/browse/AVRO-723
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.5.0
>            Reporter: Stephen Gargan
>            Priority: Minor
>         Attachments: undeclared-error.patch
>
>
> Undeclared errors thrown during service invocations are not getting returned correctly. When they are encountered, the writeError method in the responder will try to encode them using errors union for the message. However, because they are undeclared they are not present in the union and encoding causes a further AvroRuntimeException. Its this "Not in union" exception that gets returned to the client, not the undeclared problem which gets lost.
> The attached patch handles them like other system errors, calling to string on the exception and writing this as the error to be returned.

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


[jira] Updated: (AVRO-723) Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder

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

Stephen Gargan updated AVRO-723:
--------------------------------

    Attachment: undeclared-error.patch

> Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder
> -------------------------------------------------------------------------
>
>                 Key: AVRO-723
>                 URL: https://issues.apache.org/jira/browse/AVRO-723
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.5.0
>            Reporter: Stephen Gargan
>            Priority: Minor
>         Attachments: undeclared-error.patch
>
>
> Undeclared errors thrown during service invocations are not getting returned correctly. When they are encountered, the writeError method in the responder will try to encode them using errors union for the message. However, because they are undeclared they are not present in the union and encoding causes a further AvroRuntimeException. Its this "Not in union" exception that gets returned to the client, not the undeclared problem which gets lost.
> The attached patch handles them like other system errors, calling to string on the exception and writing this as the error to be returned.

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


[jira] Updated: (AVRO-723) Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder

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

Doug Cutting updated AVRO-723:
------------------------------

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

I committed this.  Thanks, Stephen!

> Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder
> -------------------------------------------------------------------------
>
>                 Key: AVRO-723
>                 URL: https://issues.apache.org/jira/browse/AVRO-723
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.5.0
>            Reporter: Stephen Gargan
>            Assignee: Stephen Gargan
>            Priority: Minor
>             Fix For: 1.5.0
>
>         Attachments: AVRO-723.patch, undeclared-error.patch, undeclared-error.patch, undeclared-error.patch
>
>
> Undeclared errors thrown during service invocations are not getting returned correctly. When they are encountered, the writeError method in the responder will try to encode them using errors union for the message. However, because they are undeclared they are not present in the union and encoding causes a further AvroRuntimeException. Its this "Not in union" exception that gets returned to the client, not the undeclared problem which gets lost.
> The attached patch handles them like other system errors, calling to string on the exception and writing this as the error to be returned.

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


[jira] Updated: (AVRO-723) Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder

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

Doug Cutting updated AVRO-723:
------------------------------

    Fix Version/s: 1.5.0
         Assignee: Stephen Gargan
           Status: Patch Available  (was: Open)

> Incorrect handling of Undeclared Errors in IPC calls to SpecificResponder
> -------------------------------------------------------------------------
>
>                 Key: AVRO-723
>                 URL: https://issues.apache.org/jira/browse/AVRO-723
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.5.0
>            Reporter: Stephen Gargan
>            Assignee: Stephen Gargan
>            Priority: Minor
>             Fix For: 1.5.0
>
>         Attachments: AVRO-723.patch, undeclared-error.patch, undeclared-error.patch, undeclared-error.patch
>
>
> Undeclared errors thrown during service invocations are not getting returned correctly. When they are encountered, the writeError method in the responder will try to encode them using errors union for the message. However, because they are undeclared they are not present in the union and encoding causes a further AvroRuntimeException. Its this "Not in union" exception that gets returned to the client, not the undeclared problem which gets lost.
> The attached patch handles them like other system errors, calling to string on the exception and writing this as the error to be returned.

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