Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: break from retry loop when key is not found #1535

Merged
merged 5 commits into from
Mar 5, 2024
Merged

fix: break from retry loop when key is not found #1535

merged 5 commits into from
Mar 5, 2024

Conversation

yhl25
Copy link
Contributor

@yhl25 yhl25 commented Mar 3, 2024

  • update the nats sdk
  • avoid retrying forever when the key is not found
  • unit tests for kv store
  • update the Watch() function signature to avoid race condition between updates and done channel

Closes #1540
Closes #1536

Signed-off-by: Yashash H L <yashashhl25@gmail.com>
Signed-off-by: Yashash H L <yashashhl25@gmail.com>
}
}
if value.Created().After(lastUpdate) {
lastUpdate = value.Created()
}
}

_ = keyLister.Stop()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will we end up in double stopping because KeyLister closes stop if all is read?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we use defer?

value, err = jss.kv.Get(key)
for err != nil {
// keys can be deleted when the previous vertex pod is deleted/restarted.
if errors.Is(err, nats.ErrKeyNotFound) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add a Info statement here.

Signed-off-by: Yashash H L <yashashhl25@gmail.com>
@yhl25 yhl25 marked this pull request as ready for review March 4, 2024 08:00
Signed-off-by: Yashash H L <yashashhl25@gmail.com>
@yhl25 yhl25 requested review from vigith and whynowy March 4, 2024 09:45
test/idle-source-e2e/idle_source_test.go Outdated Show resolved Hide resolved
Signed-off-by: Yashash H L <yashashhl25@gmail.com>

Co-authored-by: Vigith Maurice <vigith@gmail.com>
@yhl25 yhl25 enabled auto-merge (squash) March 5, 2024 02:21
@yhl25 yhl25 merged commit cd05c47 into main Mar 5, 2024
19 of 20 checks passed
@yhl25 yhl25 deleted the kv-break branch March 5, 2024 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants