|
|
|
|
50
|
|
50
|
|
51
|
// job timeout count
|
51
|
// job timeout count
|
52
|
private volatile long minTim = System.currentTimeMillis()/60000; // ms > min
|
52
|
private volatile long minTim = System.currentTimeMillis()/60000; // ms > min
|
53
|
- private volatile Map<Integer, AtomicInteger> jobTimeoutCountMap = new ConcurrentHashMap<>();
|
|
|
|
|
53
|
+ private volatile ConcurrentHashMap<Integer, AtomicInteger> jobTimeoutCountMap = new ConcurrentHashMap<>();
|
54
|
|
54
|
|
55
|
|
55
|
|
56
|
/**
|
56
|
/**
|
|
|
|
|
89
|
// incr timeout-count-map
|
89
|
// incr timeout-count-map
|
90
|
long cost = System.currentTimeMillis()-start;
|
90
|
long cost = System.currentTimeMillis()-start;
|
91
|
if (cost > 500) { // ob-timeout threshold 500ms
|
91
|
if (cost > 500) { // ob-timeout threshold 500ms
|
92
|
- AtomicInteger timeoutCount = jobTimeoutCountMap.put(jobId, new AtomicInteger(1));
|
|
|
|
|
92
|
+ AtomicInteger timeoutCount = jobTimeoutCountMap.putIfAbsent(jobId, new AtomicInteger(1));
|
93
|
if (timeoutCount != null) {
|
93
|
if (timeoutCount != null) {
|
94
|
timeoutCount.incrementAndGet();
|
94
|
timeoutCount.incrementAndGet();
|
95
|
}
|
95
|
}
|