brianfrankcooper / YCSB

Yahoo! Cloud Serving Benchmark
Apache License 2.0
4.96k stars 2.25k forks source link

Exception while running redis #353

Closed bigbes closed 9 years ago

bigbes commented 9 years ago
java -cp /tmp/ycsb-0.2.0-RC3/redis-binding/conf:/tmp/ycsb-0.2.0-RC3/conf:/tmp/ycsb-0.2.0-RC3/lib/core-0.2.0-RC3.jar:/tmp/ycsb-0.2.0-RC3/lib/jackson-core-asl-1.9.4.jar:/tmp/ycsb-0.2.0-RC3/lib/HdrHistogram-2.1.4.jar:/tmp/ycsb-0.2.0-RC3/lib/jackson-mapper-asl-1.9.4.jar:/tmp/ycsb-0.2.0-RC3/redis-binding/lib/commons-pool-1.5.5.jar:/tmp/ycsb-0.2.0-RC3/redis-binding/lib/redis-binding-0.2.0-RC3.jar:/tmp/ycsb-0.2.0-RC3/redis-binding/lib/jedis-2.0.0.jar com.yahoo.ycsb.Client -db com.yahoo.ycsb.db.RedisClient -P workloads/workloada -s -threads 64 -p measurementtype=timeseries -p timeseries.granularity=2000 -p operationcount=5000000 -p exporter=com.yahoo.ycsb.measurements.exporter.JSONArrayMeasurementsExporter -p recordcount=2000000 -p redis.host=sh4.tarantool.org -p redis.port=6400 -p exportfile=A-1.output -t
Loading workload...
Starting test.
2015-07-14 06:50:47:183 0 sec: 0 operations;
java.lang.NullPointerException
    at com.yahoo.ycsb.measurements.OneMeasurementTimeSeries.reportReturnCode(OneMeasurementTimeSeries.java:162)
    at com.yahoo.ycsb.measurements.Measurements.reportReturnCode(Measurements.java:240)
    at com.yahoo.ycsb.DBWrapper.update(DBWrapper.java:141)
    at com.yahoo.ycsb.workloads.CoreWorkload.doTransactionUpdate(CoreWorkload.java:754)
    at com.yahoo.ycsb.workloads.CoreWorkload.doTransaction(CoreWorkload.java:570)
    at com.yahoo.ycsb.ClientThread.run(Client.java:235)

It's hard to reproduce, so i can't create test case..

bigbes commented 9 years ago

It's where it happens

        @Override
        public void reportReturnCode(int code) {
                Integer Icode=code;
                if (!returncodes.containsKey(Icode))
                {   
                        int[] val=new int[1];
                        val[0]=0;
                        returncodes.put(Icode,val);
                }   
                returncodes.get(Icode)[0]++; // This string
        }   
busbey commented 9 years ago

Yep. HashMap is no good for multitheeaded use. Looks like only the OneMeasurementHdrHistogram does this correctly. We should uodate the rest to match, or maybe pull reportReturnCode up into OneMeasurement.

Interested in putting together a patch @bigbes?

bigbes commented 9 years ago

Ok, i can do it at weekend, i think.