packet sizes that exceed the default buffer send size result in disconnection

Bug #418927 reported by Eric Lambert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gearman Java
Fix Released
High
Eric Lambert

Bug Description

Submitting a packet to the jobserver who's total size exceeds the Default Socket Send Size (32,768), will result in the connection being dropped.

The problem is with the GearamanNIOJobServerConnection write method. If the packet we are writing exceeds the amount of free space in the write buffer, we allocate a larger buffer then place any pre-existing bits into the buffer and then place the bits of the packet into the buffer for transmission across the wire.

The problem was that we are not correctly moving an pre-existing bits into the new buffer and thereby creating a corrupt message. When that message is sent to the server, the server rejects the corrupt message and drops the connection.

Related branches

Eric Lambert (elambert)
Changed in gearman-java:
importance: Undecided → High
assignee: nobody → Eric Lambert (elambert)
milestone: none → 0.03
status: New → In Progress
Eric Lambert (elambert)
Changed in gearman-java:
status: In Progress → Fix Committed
Revision history for this message
Wilton Risenhoover (wilton-robotdough) wrote :

I upgraded the library to gearman-java 0.03, and although I'm not getting the NIO error, I'm still getting an error of some type. I'll keep poking at this to see if I can figure it out.

22:49:21,798 DEBUG (com.xxx.gearman.ScreenerAdvancedFunction.executeFunction:111) - row = [ZUMZ, ZUMIEZ INC, $18.81]
22:49:21,798 DEBUG (com.xxx.gearman.ScreenerAdvancedFunction.executeFunction:111) - row = [ZZ, SEALY CORP, $2.60]
22:49:21,798 WARN (com.xxx.gearman.ScreenerAdvancedFunction.executeFunction:140) - Passing results of length 150159 to client
Jul 23, 2010 10:49:23 PM org.gearman.worker.GearmanWorkerImpl submitFunction
WARNING: Exception while getting function results
java.lang.NullPointerException
 at org.gearman.worker.AbstractGearmanFunction.call(AbstractGearmanFunction.java:125)
 at org.gearman.worker.AbstractGearmanFunction.call(AbstractGearmanFunction.java:20)
 at org.gearman.worker.GearmanWorkerImpl.submitFunction(GearmanWorkerImpl.java:483)
 at org.gearman.worker.GearmanWorkerImpl.work(GearmanWorkerImpl.java:171)
 at com.xxx.gearman.RobotWorker.start(RobotWorker.java:82)
 at com.xxx.gearman.RobotWorker.main(RobotWorker.java:122)
Exception in thread "main" java.lang.NullPointerException
 at org.gearman.worker.GearmanWorkerImpl.submitFunction(GearmanWorkerImpl.java:506)
 at org.gearman.worker.GearmanWorkerImpl.work(GearmanWorkerImpl.java:171)
 at com.xxx.gearman.RobotWorker.start(RobotWorker.java:82)
 at com.xxx.gearman.RobotWorker.main(RobotWorker.java:122)

Eric Lambert (elambert)
Changed in gearman-java:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.