How long is the delay between retries of EventBus.RetryableException?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite












In Platform Events, if you throw EventBus.RetryableException, the doc states:




Events are resent after a small delay. The delay increases in
subsequent retries.




So, how small is small and how large is "increases"?










share|improve this question



























    up vote
    2
    down vote

    favorite












    In Platform Events, if you throw EventBus.RetryableException, the doc states:




    Events are resent after a small delay. The delay increases in
    subsequent retries.




    So, how small is small and how large is "increases"?










    share|improve this question























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      In Platform Events, if you throw EventBus.RetryableException, the doc states:




      Events are resent after a small delay. The delay increases in
      subsequent retries.




      So, how small is small and how large is "increases"?










      share|improve this question













      In Platform Events, if you throw EventBus.RetryableException, the doc states:




      Events are resent after a small delay. The delay increases in
      subsequent retries.




      So, how small is small and how large is "increases"?







      platform-event






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 3 hours ago









      cropredy

      34.5k439117




      34.5k439117




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          So, I ran a controlled test -- your mileage may vary.



          Controlled test was 100 Platform Events submitted in a single statement



          EventBus.publish(myEvents);


          The consuming Apex trigger coerced a DML exception that was in turn interpreted as a "transient" exception and the Apex trigger code threw EventBus.RetryableException. No other activity was occurring on the org; no other events were published.



          (100 Events) Results (# secs between each retry)



          Retry 1: 15s
          Retry 2: 32s
          Retry 3: 27s
          Retry 4: 31s
          Retry 5: 29s
          Retry 6: 61s
          Retry 7: 60s
          Retry 8: 59s
          Retry 9: 61s


          I repeated the experiment with a single event (rather than 100)



          (1 event) Results (#secs between each retry)



          Retry 1: 28s
          Retry 2: 30s
          Retry 3: 30s
          Retry 4: 29s
          Retry 5: 31s
          Retry 6: 60s
          Retry 7: 60s
          Retry 8: 60s
          Retry 9: 60s


          So, based on these small test sets, I would say, that as of V44, the first 5 retries are spaced ~30s apart and the next 4 retries are spaced 60s apart. (Don't go past nine retries as otherwise your trigger will be marked in error and no new events can be consumed)



          The EventBus.RetryableException exception is super useful in dealing with DmlException UNABLE_TO_LOCK_ROW and Query Exception Record Not Available



          Note that it is not a panacea. Consider this:



          First transaction includes events 1-10 and encounters a transient exception. Trigger throws EventBus.RetryableException



          When the retry occurs, there might now be events 1-30 available to the transaction. Even if the record lock issue affecting events 1-10 has cleared, if a new record lock issue affects events 11-30 and the transaction throws EventBus.RetryableException again, events 1-10 are swept up as innocent bystanders and thrown into the replay queue along with events 11-30. And so on.






          share|improve this answer




















          • +1 Nifty, although if not documented, I'm not sure you should rely on this being true for future releases/server load/etc, although it's nice to even have an estimate of any sort.
            – sfdcfox
            3 hours ago










          • @sfdcfox -- hence the your mileage may vary -- i'm not relying on this, believe me. I was functional testing this feature and was curious
            – cropredy
            40 mins ago










          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "459"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f238343%2fhow-long-is-the-delay-between-retries-of-eventbus-retryableexception%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote













          So, I ran a controlled test -- your mileage may vary.



          Controlled test was 100 Platform Events submitted in a single statement



          EventBus.publish(myEvents);


          The consuming Apex trigger coerced a DML exception that was in turn interpreted as a "transient" exception and the Apex trigger code threw EventBus.RetryableException. No other activity was occurring on the org; no other events were published.



          (100 Events) Results (# secs between each retry)



          Retry 1: 15s
          Retry 2: 32s
          Retry 3: 27s
          Retry 4: 31s
          Retry 5: 29s
          Retry 6: 61s
          Retry 7: 60s
          Retry 8: 59s
          Retry 9: 61s


          I repeated the experiment with a single event (rather than 100)



          (1 event) Results (#secs between each retry)



          Retry 1: 28s
          Retry 2: 30s
          Retry 3: 30s
          Retry 4: 29s
          Retry 5: 31s
          Retry 6: 60s
          Retry 7: 60s
          Retry 8: 60s
          Retry 9: 60s


          So, based on these small test sets, I would say, that as of V44, the first 5 retries are spaced ~30s apart and the next 4 retries are spaced 60s apart. (Don't go past nine retries as otherwise your trigger will be marked in error and no new events can be consumed)



          The EventBus.RetryableException exception is super useful in dealing with DmlException UNABLE_TO_LOCK_ROW and Query Exception Record Not Available



          Note that it is not a panacea. Consider this:



          First transaction includes events 1-10 and encounters a transient exception. Trigger throws EventBus.RetryableException



          When the retry occurs, there might now be events 1-30 available to the transaction. Even if the record lock issue affecting events 1-10 has cleared, if a new record lock issue affects events 11-30 and the transaction throws EventBus.RetryableException again, events 1-10 are swept up as innocent bystanders and thrown into the replay queue along with events 11-30. And so on.






          share|improve this answer




















          • +1 Nifty, although if not documented, I'm not sure you should rely on this being true for future releases/server load/etc, although it's nice to even have an estimate of any sort.
            – sfdcfox
            3 hours ago










          • @sfdcfox -- hence the your mileage may vary -- i'm not relying on this, believe me. I was functional testing this feature and was curious
            – cropredy
            40 mins ago














          up vote
          2
          down vote













          So, I ran a controlled test -- your mileage may vary.



          Controlled test was 100 Platform Events submitted in a single statement



          EventBus.publish(myEvents);


          The consuming Apex trigger coerced a DML exception that was in turn interpreted as a "transient" exception and the Apex trigger code threw EventBus.RetryableException. No other activity was occurring on the org; no other events were published.



          (100 Events) Results (# secs between each retry)



          Retry 1: 15s
          Retry 2: 32s
          Retry 3: 27s
          Retry 4: 31s
          Retry 5: 29s
          Retry 6: 61s
          Retry 7: 60s
          Retry 8: 59s
          Retry 9: 61s


          I repeated the experiment with a single event (rather than 100)



          (1 event) Results (#secs between each retry)



          Retry 1: 28s
          Retry 2: 30s
          Retry 3: 30s
          Retry 4: 29s
          Retry 5: 31s
          Retry 6: 60s
          Retry 7: 60s
          Retry 8: 60s
          Retry 9: 60s


          So, based on these small test sets, I would say, that as of V44, the first 5 retries are spaced ~30s apart and the next 4 retries are spaced 60s apart. (Don't go past nine retries as otherwise your trigger will be marked in error and no new events can be consumed)



          The EventBus.RetryableException exception is super useful in dealing with DmlException UNABLE_TO_LOCK_ROW and Query Exception Record Not Available



          Note that it is not a panacea. Consider this:



          First transaction includes events 1-10 and encounters a transient exception. Trigger throws EventBus.RetryableException



          When the retry occurs, there might now be events 1-30 available to the transaction. Even if the record lock issue affecting events 1-10 has cleared, if a new record lock issue affects events 11-30 and the transaction throws EventBus.RetryableException again, events 1-10 are swept up as innocent bystanders and thrown into the replay queue along with events 11-30. And so on.






          share|improve this answer




















          • +1 Nifty, although if not documented, I'm not sure you should rely on this being true for future releases/server load/etc, although it's nice to even have an estimate of any sort.
            – sfdcfox
            3 hours ago










          • @sfdcfox -- hence the your mileage may vary -- i'm not relying on this, believe me. I was functional testing this feature and was curious
            – cropredy
            40 mins ago












          up vote
          2
          down vote










          up vote
          2
          down vote









          So, I ran a controlled test -- your mileage may vary.



          Controlled test was 100 Platform Events submitted in a single statement



          EventBus.publish(myEvents);


          The consuming Apex trigger coerced a DML exception that was in turn interpreted as a "transient" exception and the Apex trigger code threw EventBus.RetryableException. No other activity was occurring on the org; no other events were published.



          (100 Events) Results (# secs between each retry)



          Retry 1: 15s
          Retry 2: 32s
          Retry 3: 27s
          Retry 4: 31s
          Retry 5: 29s
          Retry 6: 61s
          Retry 7: 60s
          Retry 8: 59s
          Retry 9: 61s


          I repeated the experiment with a single event (rather than 100)



          (1 event) Results (#secs between each retry)



          Retry 1: 28s
          Retry 2: 30s
          Retry 3: 30s
          Retry 4: 29s
          Retry 5: 31s
          Retry 6: 60s
          Retry 7: 60s
          Retry 8: 60s
          Retry 9: 60s


          So, based on these small test sets, I would say, that as of V44, the first 5 retries are spaced ~30s apart and the next 4 retries are spaced 60s apart. (Don't go past nine retries as otherwise your trigger will be marked in error and no new events can be consumed)



          The EventBus.RetryableException exception is super useful in dealing with DmlException UNABLE_TO_LOCK_ROW and Query Exception Record Not Available



          Note that it is not a panacea. Consider this:



          First transaction includes events 1-10 and encounters a transient exception. Trigger throws EventBus.RetryableException



          When the retry occurs, there might now be events 1-30 available to the transaction. Even if the record lock issue affecting events 1-10 has cleared, if a new record lock issue affects events 11-30 and the transaction throws EventBus.RetryableException again, events 1-10 are swept up as innocent bystanders and thrown into the replay queue along with events 11-30. And so on.






          share|improve this answer












          So, I ran a controlled test -- your mileage may vary.



          Controlled test was 100 Platform Events submitted in a single statement



          EventBus.publish(myEvents);


          The consuming Apex trigger coerced a DML exception that was in turn interpreted as a "transient" exception and the Apex trigger code threw EventBus.RetryableException. No other activity was occurring on the org; no other events were published.



          (100 Events) Results (# secs between each retry)



          Retry 1: 15s
          Retry 2: 32s
          Retry 3: 27s
          Retry 4: 31s
          Retry 5: 29s
          Retry 6: 61s
          Retry 7: 60s
          Retry 8: 59s
          Retry 9: 61s


          I repeated the experiment with a single event (rather than 100)



          (1 event) Results (#secs between each retry)



          Retry 1: 28s
          Retry 2: 30s
          Retry 3: 30s
          Retry 4: 29s
          Retry 5: 31s
          Retry 6: 60s
          Retry 7: 60s
          Retry 8: 60s
          Retry 9: 60s


          So, based on these small test sets, I would say, that as of V44, the first 5 retries are spaced ~30s apart and the next 4 retries are spaced 60s apart. (Don't go past nine retries as otherwise your trigger will be marked in error and no new events can be consumed)



          The EventBus.RetryableException exception is super useful in dealing with DmlException UNABLE_TO_LOCK_ROW and Query Exception Record Not Available



          Note that it is not a panacea. Consider this:



          First transaction includes events 1-10 and encounters a transient exception. Trigger throws EventBus.RetryableException



          When the retry occurs, there might now be events 1-30 available to the transaction. Even if the record lock issue affecting events 1-10 has cleared, if a new record lock issue affects events 11-30 and the transaction throws EventBus.RetryableException again, events 1-10 are swept up as innocent bystanders and thrown into the replay queue along with events 11-30. And so on.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 3 hours ago









          cropredy

          34.5k439117




          34.5k439117











          • +1 Nifty, although if not documented, I'm not sure you should rely on this being true for future releases/server load/etc, although it's nice to even have an estimate of any sort.
            – sfdcfox
            3 hours ago










          • @sfdcfox -- hence the your mileage may vary -- i'm not relying on this, believe me. I was functional testing this feature and was curious
            – cropredy
            40 mins ago
















          • +1 Nifty, although if not documented, I'm not sure you should rely on this being true for future releases/server load/etc, although it's nice to even have an estimate of any sort.
            – sfdcfox
            3 hours ago










          • @sfdcfox -- hence the your mileage may vary -- i'm not relying on this, believe me. I was functional testing this feature and was curious
            – cropredy
            40 mins ago















          +1 Nifty, although if not documented, I'm not sure you should rely on this being true for future releases/server load/etc, although it's nice to even have an estimate of any sort.
          – sfdcfox
          3 hours ago




          +1 Nifty, although if not documented, I'm not sure you should rely on this being true for future releases/server load/etc, although it's nice to even have an estimate of any sort.
          – sfdcfox
          3 hours ago












          @sfdcfox -- hence the your mileage may vary -- i'm not relying on this, believe me. I was functional testing this feature and was curious
          – cropredy
          40 mins ago




          @sfdcfox -- hence the your mileage may vary -- i'm not relying on this, believe me. I was functional testing this feature and was curious
          – cropredy
          40 mins ago

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f238343%2fhow-long-is-the-delay-between-retries-of-eventbus-retryableexception%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          Long meetings (6-7 hours a day): Being “babysat” by supervisor

          Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

          Confectionery