How long is the delay between retries of EventBus.RetryableException?
Clash 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"?
platform-event
add a comment |Â
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"?
platform-event
add a comment |Â
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"?
platform-event
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
platform-event
asked 3 hours ago
cropredy
34.5k439117
34.5k439117
add a comment |Â
add a comment |Â
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.
+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 theyour mileage may vary
-- i'm not relying on this, believe me. I was functional testing this feature and was curious
â cropredy
40 mins ago
add a comment |Â
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.
+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 theyour mileage may vary
-- i'm not relying on this, believe me. I was functional testing this feature and was curious
â cropredy
40 mins ago
add a comment |Â
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.
+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 theyour mileage may vary
-- i'm not relying on this, believe me. I was functional testing this feature and was curious
â cropredy
40 mins ago
add a comment |Â
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.
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.
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 theyour mileage may vary
-- i'm not relying on this, believe me. I was functional testing this feature and was curious
â cropredy
40 mins ago
add a comment |Â
+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 theyour 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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password