Details
-
Bug
-
Resolution: Fixed
-
Major
-
5.5.0
-
Enterprise Edition 5.5.0 build 2176
-
Untriaged
-
Centos 64-bit
-
Unknown
Description
Eventing code to Repro
function OnUpdate(doc,meta) {
|
var expiry = Math.round((new Date()).getTime() / 1000) + 30;
|
var time_rand = random_gen(); // ----> int
|
log('creating crontimer : ', time_rand);
|
cronTimer(NDtimerCallback, time_rand, expiry);
|
}
|
function NDtimerCallback(docid, expiry) {
|
log('creating bucket op : ', docid);
|
dst_bucket[docid] = 'from NDtimerCallback';
|
}
|
function random_gen(){
|
var rand = Math.floor(Math.random() * 20000000) * Math.floor(Math.random() * 20000000);
|
var time_rand = Math.round((new Date()).getTime() / 1000) + rand;
|
return time_rand;
|
}
|
Since time_rand is an int and we assume its going to be a string we see unmarshal errors and following messages are seen in eventing log
2018-03-14T00:07:44.095-07:00 [Error] Consumer::getCronTimerCallback [worker_cron_timer_op_retry_1:/tmp/127.0.0.1:8091_worker_cron_timer_op_retry_1.sock:27944] Bucket fetch failed for cron timer key: <ud>cron_timer_op_retry::2018-03-14T07:07:24Z0</ud> val: <ud>&{[{NDtimerCallback }] }</ud>, err: json: cannot unmarshal number into Go value of type string
|
Cron timer data from metadata bucket
{
|
"cron_timers": [{
|
"callback_func": "NDtimerCallback",
|
"payload": 274700495669869
|
}, {
|
"callback_func": "NDtimerCallback",
|
"payload": 185158701515478
|
}, {
|
"callback_func": "NDtimerCallback",
|
"payload": 10458915851862
|
}],
|
"counter": 3,
|
"version": "vulcan"
|
}
|
Logs attached.
Attachments
Issue Links
- depends on
-
MB-27374 Cache cron timers into plasma (Low throughput for creating cron timers)
- Closed