Index: src/core/org/apache/jmeter/samplers/BatchSampleSender.java =================================================================== --- src/core/org/apache/jmeter/samplers/BatchSampleSender.java (revision 1509948) +++ src/core/org/apache/jmeter/samplers/BatchSampleSender.java (working copy) @@ -143,6 +143,7 @@ */ @Override public void sampleOccurred(SampleEvent e) { + List clonedStore = null; synchronized (sampleStore) { sampleStore.add(e); final int sampleCount = sampleStore.size(); @@ -167,18 +168,23 @@ } if (sendNow){ - try { - log.debug("Firing sample"); - listener.processBatch(sampleStore); - sampleStore.clear(); - if (timeThresholdMs != -1) { - this.batchSendTime = now + timeThresholdMs; - } - } catch (RemoteException err) { - log.error("sampleOccurred", err); - } + clonedStore = (ArrayList)((ArrayList)sampleStore).clone(); + sampleStore.clear(); + if (timeThresholdMs != -1) { + this.batchSendTime = now + timeThresholdMs; + } } } // synchronized(sampleStore) + + if (clonedStore != null){ + try { + log.debug("Firing sample"); + listener.processBatch(clonedStore); + clonedStore.clear(); + } catch (RemoteException err) { + log.error("sampleOccurred", err); + } + } } /**