Skip to content
Snippets Groups Projects

Add more aggressive retry schedule for failed bridges

Merged onyinyang requested to merge onyinyang/bridgestrap:main into main
2 unresolved threads

In an effort to address better handling of gone resources for Lox's purposes, this commit introduces a more aggressive retry schedule for bridges that fail bridgestrap's test. For now, the error timeout can be set so bridges that fail a test are only cached for x (default 1) hour(s). Follow up work on rdsys (and adding similar functionality for onbasca tests) to follow. This also addresses #29 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
124 125 now := time.Now().UTC()
125 126 tc.l.Lock()
126 127 for index, entry := range (*tc).Entries {
127 if entry.Time.Before(now.Add(-(*tc).entryTimeout)) {
128 // If the test returned an error, shorten the time it is cached
129 // to 1 hour so it can be tested again more quickly.
130 // This aims to prevent bridges that are temporarily down
131 // due to unfortunate test timing from being marked as `gone`
132 // by rdsys
133 if entry.Error != "" && entry.Time.Before(now.Add(-(*tc).errorEntryTimeout)) {
134 log.Printf("Deleting cache entry: %s", index)
135 delete((*tc).Entries, index)
136 } else if entry.Time.Before(now.Add(-(*tc).entryTimeout)) {
  • 124 125 now := time.Now().UTC()
    125 126 tc.l.Lock()
    126 127 for index, entry := range (*tc).Entries {
    127 if entry.Time.Before(now.Add(-(*tc).entryTimeout)) {
    128 // If the test returned an error, shorten the time it is cached
    129 // to 1 hour so it can be tested again more quickly.
  • Looks good. I left a couple of nitpicks but I will be fine with it to be merged as it is if you disagree with me.

  • meskio approved this merge request

    approved this merge request

  • onyinyang added 1 commit

    added 1 commit

    • 9dc0cb39 - Add more aggressive retry schedule for failed bridges

    Compare with previous version

  • The new changes look good

  • onyinyang mentioned in commit b3a7eb40

    mentioned in commit b3a7eb40

  • merged

  • Please register or sign in to reply
    Loading