|
|
-
what's the purpose of one-way, and why does it cause problems with python?
Mark Lewandowski 2010-10-30, 02:28
I'm writing a python app to talk to flume using the new avroSource feature, and I'm running into an issue when when communicating between flume (written in java) and my python script. I've taken the flume.avpr schema file from flume and used it to communicate between two python processes without any problems, but as soon as I try to communicate with flume I get an error saying:
org.apache.avro.AvroRuntimeException: Not both one-way: append
I can't find any mention of the one-way flag in the python bindings for avro, so I'm guessing that this flag is not getting set when the rpc call is sent across the wire, causing Responder.java to throw the above exception. I've checked, and the java implementation of ipc.Responder checks to see that both the local and remote messages oneWay property are set to identical values.
I've been stuck on this problem for a day now, so any help would be greatly appreciated.
Thanks,
-Mark
+
Mark Lewandowski 2010-10-30, 02:28
-
Re: what's the purpose of one-way, and why does it cause problems with python?
Doug Cutting 2010-11-01, 17:50
On 10/29/2010 07:28 PM, Mark Lewandowski wrote: > org.apache.avro.AvroRuntimeException: Not both one-way: append
My guess is that Python is not preserving this attribute when it renders the protocol as JSON. Also, perhaps it is a bug that Java requires that this attribute matches even when the transport (HTTP) doesn't support one-way messages. If my analysis is correct we could fix this either by fixing Python to preserve this attribute in the protocol's JSON or for Java to ignore this attribute when using a stateless transport like HTTP.
Please file a bug in Jira.
Thanks,
Doug
+
Doug Cutting 2010-11-01, 17:50
-
Re: what's the purpose of one-way, and why does it cause problems with python?
Doug Cutting 2010-11-01, 18:00
On 11/01/2010 10:50 AM, Doug Cutting wrote: > we could fix this either by > fixing Python to preserve this attribute in the protocol's JSON or for > Java to ignore this attribute when using a stateless transport like HTTP.
A third short-term option might be to remove the one-way specification from the Flume protocols.
And, to answer the question in the subject, the one-way attribute declares that a message does not require any response. A two-way void-returning message that declares no errors must still always return an empty response when it successfully completes, but a one-way message is permitted to never return a response. Over HTTP, Avro maps requests one-to-one to HTTP requests, so every request also has an HTTP response and one-way is ignored. But other transports might do this differently. Java's SocketTransceiver and SocketServer implement one-way messages so that requests are truly fire-and-forget. Control is returned to the caller as soon as a one-way request is written.
Doug
+
Doug Cutting 2010-11-01, 18:00
-
Re: what's the purpose of one-way, and why does it cause problems with python?
Bruce Mitchener 2010-10-31, 03:26
The Python support for Avro RPC does not currently support the oneway stuff. According to hammer, Henry was working on it at a recent hackathon, so hopefully someone will have some more useful information for you on Monday!
- Bruce
On Sat, Oct 30, 2010 at 9:28 AM, Mark Lewandowski < [EMAIL PROTECTED]> wrote:
> I'm writing a python app to talk to flume using the new avroSource feature, > and I'm running into an issue when when communicating between flume (written > in java) and my python script. I've taken the flume.avpr schema file from > flume and used it to communicate between two python processes without any > problems, but as soon as I try to communicate with flume I get an error > saying: > > org.apache.avro.AvroRuntimeException: Not both one-way: append > > I can't find any mention of the one-way flag in the python bindings for > avro, so I'm guessing that this flag is not getting set when the rpc call is > sent across the wire, causing Responder.java to throw the above exception. > I've checked, and the java implementation of ipc.Responder checks to see > that both the local and remote messages oneWay property are set to identical > values. > > I've been stuck on this problem for a day now, so any help would be greatly > appreciated. > > Thanks, > > -Mark >
+
Bruce Mitchener 2010-10-31, 03:26
|
|