Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-38554

[BP MB-39078] Timer not getting fired when created during timer execution

    XMLWordPrintable

    Details

      Description

      • Create 2node cluster kv and eventing
      • Create handler which creates times and timer execution will create new timer with same refrence

       function OnUpdate(doc,meta) {
          var expiry = new Date();
          expiry.setSeconds(expiry.getSeconds() + 150);
       
       
          var context = {docID : meta.id, random_text : "e6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh07Aumoe6cZZGHuh07Aumoe6cZZGHuh07Aumoe6"};
          createTimer(timerCallback,  expiry, meta.id, context);
      }
      function timerCallback(context) {
          dst_bucket[context.docID] = context.random_text;
          var expiry = new Date();
          expiry.setSeconds(expiry.getSeconds() + 150);
          createTimer(timerCallback,  expiry, context.docID, context);
      }

      • create 1 doc in source , i can see 2051 doc in metadata (timer got created)
      • seeing 1 doc in destination and timer creation in metadata also but the new timer is not even fired since 5 min 

       

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

            Hide
            vikas.chaudhary Vikas Chaudhary added a comment -

            Same behaviour even if we have unique reference

            function OnUpdate(doc,meta) {
                try{
                var expiry = new Date();
                expiry.setSeconds(expiry.getSeconds() + 150);
                var context = {docID : meta.id, random_text : "e6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh07Aumoe6cZZGHuh07Aumoe6cZZGHuh07Aumoe6"};
                var ref = Date.now().toString();
                createTimer(timerCallback,  expiry, ref, context);
                }
                catch(e){
                    log(e);
                }
            }
            function timerCallback(context) {
                try{
                dst_bucket[context.docID] = context.random_text;
                var expiry = new Date();
                expiry.setSeconds(expiry.getSeconds() + 150);
                var ref = Date.now().toString();
                createTimer(timerCallback,  expiry, ref, context);
                }catch(e){
                    log(e);
                }
            } 

             

            Show
            vikas.chaudhary Vikas Chaudhary added a comment - Same behaviour even if we have unique reference function OnUpdate(doc,meta) { try{ var expiry = new Date(); expiry.setSeconds(expiry.getSeconds() + 150); var context = {docID : meta.id, random_text : "e6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh07Aumoe6cZZGHuh07Aumoe6cZZGHuh07Aumoe6"}; var ref = Date.now().toString(); createTimer(timerCallback, expiry, ref, context); } catch(e){ log(e); } } function timerCallback(context) { try{ dst_bucket[context.docID] = context.random_text; var expiry = new Date(); expiry.setSeconds(expiry.getSeconds() + 150); var ref = Date.now().toString(); createTimer(timerCallback, expiry, ref, context); }catch(e){ log(e); } }  
            Hide
            jeelan.poola Jeelan Poola added a comment -

            This will be addressed as part of the Improvement MB-38729 - Implement cancelTimer(). This MB is to track the actual test from QE perspective.

            Show
            jeelan.poola Jeelan Poola added a comment - This will be addressed as part of the Improvement MB-38729 - Implement cancelTimer() . This MB is to track the actual test from QE perspective.
            Hide
            jon.strabala Jon Strabala added a comment -

            For an eventing function with a timer making another timer

            A MH package 6.5.1-6299 did not work for Pause / Resume
            My source build on Apr 21 07:09 PST of CC did not work for Pause / Resume

            A CC package 7.0.0-1919-1 made on Apr 27 package build seems to work fine for Pause / Resume and also always present the right context

            Show
            jon.strabala Jon Strabala added a comment - For an eventing function with a timer making another timer A MH package 6.5.1-6299 did not work for Pause / Resume My source build on Apr 21 07:09 PST of CC did not work for Pause / Resume A CC package 7.0.0-1919-1 made on Apr 27 package build seems to work fine for Pause / Resume and also always present the right context
            Hide
            jeelan.poola Jeelan Poola added a comment -

            Resolving as cancelTimer() is now part of 6.6.0 builds.

            Show
            jeelan.poola Jeelan Poola added a comment - Resolving as cancelTimer() is now part of 6.6.0 builds.
            Hide
            vikas.chaudhary Vikas Chaudhary added a comment -

            verified on  6.6.0 build 7737 

            Show
            vikas.chaudhary Vikas Chaudhary added a comment - verified on  6.6.0 build 7737 

              People

              Assignee:
              jeelan.poola Jeelan Poola
              Reporter:
              vikas.chaudhary Vikas Chaudhary
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes

                    PagerDuty