BufferOverflows and garbage.

I sent this to the mailing list. But the forums seem to have better traffic.

This is just to see what happens in low bandwidth conditions.
The client code can be see on the mailing list archives. ( ugly whittle job ).

I’ve setup a Linux box to act as a service. I am throttling the network
interface to 65KB/s

I start up the SGS. My boot class opens a channel that the clients will
connect to.

The clients (4-6 ) then connect and join the channel.

One client then pushes 512 bytes with sendBroadcastData 1000 times.
( I paste in 512 chars plus a count. ).

I’m getting this Exception when i hit the throttle limit on the server.

Exception in thread “AWT-EventQueue-0” java.nio.BufferOverflowException
at java.nio.DirectByteBuffer.put(Unknown Source)
at java.nio.DirectByteBuffer.put(Unknown Source)
at
com.sun.gi.utils.nio.NIOConnection$PacketHandler.send(NIOConnection.java:300)
at com.sun.gi.utils.nio.NIOConnection.send(NIOConnection.java:378)
at
com.sun.gi.comm.users.client.impl.TCPIPUserManagerClient$1.sendBuffers(TCPIPUserManagerClient.java:168)
at
com.sun.gi.comm.users.protocol.impl.BinaryPktProtocol.sendBuffers(BinaryPktProtocol.java:633)
at
com.sun.gi.comm.users.protocol.impl.BinaryPktProtocol.sendBroadcastMsg(BinaryPktProtocol.java:349)
at
com.sun.gi.comm.users.client.impl.TCPIPUserManagerClient.sendBroadcastMsg(TCPIPUserManagerClient.java:364)
at
com.sun.gi.comm.users.client.impl.ClientConnectionManagerImpl.sendBroadcastData(ClientConnectionManagerImpl.java:340)
at
com.sun.gi.comm.users.client.impl.ClientChannelImpl.sendBroadcastData(ClientChannelImpl.java:127)
at
com.asynchrony.tire.client.TireClient$2.actionPerformed(TireClient.java:140)

What do you guys suggest… when the bandwidth restricts the ability to send?

the clients are identical. But everyonce and a while one of the clients
will start getting garbage from SGS.
“?U6hmm” with more garbage after it. should be “6hmm”.

Also I’m seeing this NullPointerException in the SGS output.

Exception in thread “inria.net.lrmp.LrmpFlow” java.lang.NullPointerException
at inria.util.EventManager.recallTimer(EventManager.java:187)
at inria.net.lrmp.LrmpImpl.idle(LrmpImpl.java:1387)
at inria.net.lrmp.LrmpFlow.run(LrmpFlow.java:201)
at java.lang.Thread.run(Thread.java:595)

Well… maybe that was not enough…
I get the java.nio.BufferOverflowException.

  1. I do a disconnect with the manager. Then in this example i have to re-auth.

or

  1. i use the manager.openChannel() again but for some reason it will not send on the channel only recieve.

The second case is troubling. If the channel is toast after the exception I can’t use .disconnect(). when i do a mbr.openChannel() it does not clean up the toasted channel reference. I’m unable to send on the original channel but I can still recieve from the other clients.
I see this in the server log.

Apr 14, 2006 10:21:22 AM com.sun.gi.logic.impl.SimulationImpl$1 userJoined
WARNING: user UUID(1145028058155:-1559707966297541816) was already joined.
Apr 14, 2006 10:21:22 AM com.sun.gi.logic.impl.SimulationImpl queueTask
SEVERE: attempt to queue task for unknown uid UUID(1145028058155:-1559707966297541816)
Apr 14, 2006 10:21:22 AM com.sun.gi.logic.impl.SimulationImpl queueTask
SEVERE: attempt to queue task for unknown uid UUID(1145028058155:-1559707966297541816)

Tell me if I’m wrong… But the SGS service must not have any idea that my original chan reference is toast. So i call to open a channel and it does not connect me… since the joinedChannel callback is not called then i am still recieving on the old chan reference. Which causes a failOverInProgress if i try to do anything with it.

how do i tell the service to clean the client out of a channel so it can get a new connection to it. Seems like the manager is still good.

Once youve created an exception throw in the UserManager all bets are off and you had better restart the server.

As far as over-flowing the buffers, ist something we are aware of as a bug. In the future the UserManager will drop the connection from any client who is not consuming the data fast enough and flush whatever data has backed up.