You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Enrico Saviano <av...@inovaos.prout.be> on 2011/04/07 12:04:29 UTC

bytes limit on rpc calls

Hello,

I'm using Avro RPC software to send messages, via 
SaslSocketServer/Transciever, and the Reflect method.

The problem I found is that I cannot send more than 49149 bytes on a 
single RPC call, 1 byte more and the software will lock.

Below, a class I wrote that replicates the issue.

Is it a bug, a limitation, or am I doing something wrong?

Thank you,
Enrico.


public class PoC {
	private final static InetSocketAddress addr =
		new InetSocketAddress("127.0.0.2", 12345);
	
	public interface ProtoInterface { int test(byte[] b); }
	
	public static void main (String[] args) {
		try {
			SaslSocketServer s = new SaslSocketServer(
					new ReflectResponder(ProtoInterface.class, new ProtoInterface() {
						public int test(byte[] b) { return b.length; } }), addr);
			s.start();
			SaslSocketTransceiver client = new SaslSocketTransceiver(addr);
			ProtoInterface proxy = (ProtoInterface) ReflectRequestor.getClient(
					ProtoInterface.class, client);

			int res = proxy.test(new byte[49149]);
			System.out.println("BYTE ARRAY LENGTH: "+res);
			res = proxy.test(new byte[49150]);
			System.out.println("NEVER REACH THIS POINT: "+res);
			client.close();
			
			try { System.out.print("Shutting down server... "); s.notify();	}
			catch (IllegalMonitorStateException e) { }	
		}
		catch (Exception e) { e.printStackTrace(); }
	}
}

Re: bytes limit on rpc calls

Posted by Enrico Saviano <av...@inovaos.prout.be>.
I tried with Avro 1.4.1 and 1.5.0 and I found the same problem.

I filed the Jira issue #AVRO-801, hope it's ok.

Thank you,
Enrico.



Doug Cutting ha scritto:
> Enrico,
> 
> This looks like it could be a bug.  What version of Avro are you using?
> 
> Can you please file a Jira issue for this?
> 
> Thanks,
> 
> Doug
> 
> On 04/07/2011 03:04 AM, Enrico Saviano wrote:
>> Hello,
>>
>> I'm using Avro RPC software to send messages, via
>> SaslSocketServer/Transciever, and the Reflect method.
>>
>> The problem I found is that I cannot send more than 49149 bytes on a
>> single RPC call, 1 byte more and the software will lock.
>>
>> Below, a class I wrote that replicates the issue.
>>
>> Is it a bug, a limitation, or am I doing something wrong?
>>
>> Thank you,
>> Enrico.
>>
>>
>> public class PoC {
>>     private final static InetSocketAddress addr =
>>         new InetSocketAddress("127.0.0.2", 12345);
>>     
>>     public interface ProtoInterface { int test(byte[] b); }
>>     
>>     public static void main (String[] args) {
>>         try {
>>             SaslSocketServer s = new SaslSocketServer(
>>                     new ReflectResponder(ProtoInterface.class, new
>> ProtoInterface() {
>>                         public int test(byte[] b) { return b.length; }
>> }), addr);
>>             s.start();
>>             SaslSocketTransceiver client = new SaslSocketTransceiver(addr);
>>             ProtoInterface proxy = (ProtoInterface)
>> ReflectRequestor.getClient(
>>                     ProtoInterface.class, client);
>>
>>             int res = proxy.test(new byte[49149]);
>>             System.out.println("BYTE ARRAY LENGTH: "+res);
>>             res = proxy.test(new byte[49150]);
>>             System.out.println("NEVER REACH THIS POINT: "+res);
>>             client.close();
>>            
>>             try { System.out.print("Shutting down server... ");
>> s.notify();    }
>>             catch (IllegalMonitorStateException e) { }   
>>         }
>>         catch (Exception e) { e.printStackTrace(); }
>>     }
>> }
> 

Re: bytes limit on rpc calls

Posted by Doug Cutting <cu...@apache.org>.
Enrico,

This looks like it could be a bug.  What version of Avro are you using?

Can you please file a Jira issue for this?

Thanks,

Doug

On 04/07/2011 03:04 AM, Enrico Saviano wrote:
> Hello,
> 
> I'm using Avro RPC software to send messages, via
> SaslSocketServer/Transciever, and the Reflect method.
> 
> The problem I found is that I cannot send more than 49149 bytes on a
> single RPC call, 1 byte more and the software will lock.
> 
> Below, a class I wrote that replicates the issue.
> 
> Is it a bug, a limitation, or am I doing something wrong?
> 
> Thank you,
> Enrico.
> 
> 
> public class PoC {
>     private final static InetSocketAddress addr =
>         new InetSocketAddress("127.0.0.2", 12345);
>     
>     public interface ProtoInterface { int test(byte[] b); }
>     
>     public static void main (String[] args) {
>         try {
>             SaslSocketServer s = new SaslSocketServer(
>                     new ReflectResponder(ProtoInterface.class, new
> ProtoInterface() {
>                         public int test(byte[] b) { return b.length; }
> }), addr);
>             s.start();
>             SaslSocketTransceiver client = new SaslSocketTransceiver(addr);
>             ProtoInterface proxy = (ProtoInterface)
> ReflectRequestor.getClient(
>                     ProtoInterface.class, client);
> 
>             int res = proxy.test(new byte[49149]);
>             System.out.println("BYTE ARRAY LENGTH: "+res);
>             res = proxy.test(new byte[49150]);
>             System.out.println("NEVER REACH THIS POINT: "+res);
>             client.close();
>            
>             try { System.out.print("Shutting down server... ");
> s.notify();    }
>             catch (IllegalMonitorStateException e) { }   
>         }
>         catch (Exception e) { e.printStackTrace(); }
>     }
> }