@@ -125,26 +125,6 @@ func (cb *CircuitBreaker) recordFailure() {
125125 }
126126}
127127
128- func isRetryableError (err error ) bool {
129- if err == nil {
130- return false
131- }
132- // Check for network-related errors that are worth retrying
133- errorStr := err .Error ()
134- return strings .Contains (errorStr , "timeout" ) ||
135- strings .Contains (errorStr , "connection refused" ) ||
136- strings .Contains (errorStr , "connection reset" ) ||
137- strings .Contains (errorStr , "temporary failure" ) ||
138- strings .Contains (errorStr , "i/o timeout" ) ||
139- strings .Contains (errorStr , "network is unreachable" ) ||
140- strings .Contains (errorStr , "context deadline exceeded" ) ||
141- strings .HasPrefix (errorStr , "retryable http error " )
142- }
143-
144- func isRetryableHTTPStatus (statusCode int ) bool {
145- return statusCode >= 500 || statusCode == 429 || statusCode == 408
146- }
147-
148128func isEndOfLogError (err error ) bool {
149129 if err == nil {
150130 return false
@@ -214,10 +194,6 @@ func fetchEntriesWithRetry(client *http.Client, logURL string, start, end int64)
214194 // This is end-of-log, don't retry but return special error type
215195 return nil , fmt .Errorf ("end_of_log: %w" , err )
216196 }
217- if ! isRetryableError (err ) {
218- log .Printf ("Non-retryable error, giving up: %v" , err )
219- break
220- }
221197
222198 // Calculate and apply backoff delay
223199 delay := calculateBackoffDelay (attempt )
@@ -250,9 +226,6 @@ func fetchEntries(client *http.Client, logURL string, start, end int64) (*GetEnt
250226
251227 if resp .StatusCode != http .StatusOK {
252228 bodyBytes , _ := io .ReadAll (resp .Body )
253- if isRetryableHTTPStatus (resp .StatusCode ) {
254- return nil , fmt .Errorf ("retryable http error %s: %s" , resp .Status , string (bodyBytes ))
255- }
256229 return nil , fmt .Errorf ("http request failed with status %s: %s" , resp .Status , string (bodyBytes ))
257230 }
258231
@@ -417,23 +390,6 @@ func initClickHouse() (*sql.DB, error) {
417390 return conn , nil
418391}
419392
420- func isRetryableDBError (err error ) bool {
421- if err == nil {
422- return false
423- }
424- errorStr := err .Error ()
425- // ClickHouse specific retryable errors
426- return strings .Contains (errorStr , "connection refused" ) ||
427- strings .Contains (errorStr , "connection reset" ) ||
428- strings .Contains (errorStr , "timeout" ) ||
429- strings .Contains (errorStr , "network is unreachable" ) ||
430- strings .Contains (errorStr , "broken pipe" ) ||
431- strings .Contains (errorStr , "connection lost" ) ||
432- strings .Contains (errorStr , "server is not ready" ) ||
433- strings .Contains (errorStr , "too many connections" ) ||
434- strings .Contains (errorStr , "context deadline exceeded" )
435- }
436-
437393func boolToUint8 (b bool ) uint8 {
438394 if b {
439395 return 1
@@ -526,11 +482,6 @@ func ingestBatchWithRetry(db *sql.DB, batch []*CertificateDetails, cb *CircuitBr
526482 break
527483 }
528484
529- if ! isRetryableDBError (err ) {
530- log .Printf ("Non-retryable database error, giving up: %v" , err )
531- break
532- }
533-
534485 delay := calculateBackoffDelay (attempt )
535486 log .Printf ("Retrying database batch operation in %v..." , delay )
536487 time .Sleep (delay )
@@ -658,12 +609,6 @@ func getLatestLogIndexWithRetry(db *sql.DB, logID string, cb *CircuitBreaker) (i
658609 break
659610 }
660611
661- // Check if error is retryable
662- if ! isRetryableDBError (err ) {
663- log .Printf ("Non-retryable database error, giving up: %v" , err )
664- break
665- }
666-
667612 // Calculate and apply backoff delay
668613 delay := calculateBackoffDelay (attempt )
669614 log .Printf ("Retrying latest log index fetch in %v..." , delay )
0 commit comments