Skip to content

Commit

Permalink
alternate fix for issue SeasideSt#60 and also fixes issue SeasideSt#66
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrichau committed Apr 4, 2015
1 parent 0712035 commit 2df8668
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 28 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*seaside-gemstone-core
retryDelays

^#(10 100 100 100 500 500 1000 1000 10000 10000)
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@
seasideProcessRequest: aNativeRequest adaptor: adaptor resultBlock: resultBlock

| result |
[ | retryCount result count |
retryCount := self retryCount.
count := 1.
retryCount timesRepeat: [
[ self retryDelays do: [:retryDelay |
(result := self
seasideProcessRequestWithRetry: aNativeRequest
resultBlock: resultBlock) ~~ nil
ifTrue: [ ^result ].
System _sessionCacheStatAt: 2 put: ((System _sessionCacheStatAt: 2) + 1). "requests retried"
(Delay forMilliseconds: self retryDelay * count) wait.
count := count + 1 ].
"exceeded retry limit"
^adaptor internalServerErrorMessage: 'Too many retries: ', (retryCount+1) printString ]
on: Error
do: [:ex |
self doAbortTransaction.
result := adaptor internalServerErrorMessage: ex description.
"Do an explicit return. Because of the abort above, the default action for an exception (resume) is set. see bug39246."
ex return: nil ].
^result
System _sessionCacheStatAt: 2 put: ((System _sessionCacheStatAt: 2) + 1). "requests retried"
(Delay forMilliseconds: retryDelay) wait ].
"exceeded retry limit"
^adaptor internalServerErrorMessage: 'Too many retries: ', (self retryDelays size + 1) printString ]
on: Error
do: [:ex |
self doAbortTransaction.
result := adaptor internalServerErrorMessage: ex description.
"Do an explicit return. Because of the abort above, the default action for an exception (resume) is set. see bug39246."
ex return: nil ].
^result
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"class" : {
},
"instance" : {
"retryCount" : "dkh 12/23/2009 12:26",
"retryDelay" : "dkh 12/23/2009 12:26",
"retryDelays" : "JohanBrichau 04/04/2015 02:48",
"seasideLogServerStart:port:" : "dkh 12/23/2009 14:40",
"seasideProcessRequest:adaptor:resultBlock:" : "DaleHenrichs 08/04/2010 16:46",
"seasideProcessRequest:adaptor:resultBlock:" : "JohanBrichau 04/04/2015 02:46",
"seasideProcessRequestWithRetry:resultBlock:" : "dkh 05/31/2011 13:59" } }

Large diffs are not rendered by default.

0 comments on commit 2df8668

Please sign in to comment.