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 check invalid binds #16959

Merged
merged 3 commits into from
Jun 18, 2024
Merged

fix check invalid binds #16959

merged 3 commits into from
Jun 18, 2024

Conversation

iamlinjunhong
Copy link
Contributor

@iamlinjunhong iamlinjunhong commented Jun 18, 2024

User description

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #https://github.com/matrixorigin/MO-Cloud/issues/3490 #https://github.com/matrixorigin/MO-Cloud/issues/3530
#https://github.com/matrixorigin/MO-Cloud/issues/3521 #https://github.com/matrixorigin/MO-Cloud/issues/3512

What this PR does / why we need it:

fix check invalid binds


PR Type

Bug fix, Tests


Description

  • Added a nil check before calling isRetryError in the checkInvalidBinds method to prevent potential nil pointer dereference.
  • Modified TestRetryValidateService to include a nil check before isRetryError.
  • Added a new test TestValidateService to validate service responses, ensuring correct behavior for both valid and invalid service IDs.

Changes walkthrough 📝

Relevant files
Bug fix
lock_table_allocator.go
Add nil check before retry error validation in `checkInvalidBinds`

pkg/lockservice/lock_table_allocator.go

  • Added a nil check before calling isRetryError in checkInvalidBinds
    method.
  • +1/-1     
    Tests
    rpc_test.go
    Enhance service validation tests with additional checks   

    pkg/lockservice/rpc_test.go

  • Modified TestRetryValidateService to include a nil check before
    isRetryError.
  • Added a new test TestValidateService to validate service responses.
  • +29/-6   

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review [1-5] 2
    🧪 Relevant tests Yes
    🔒 Security concerns No
    ⚡ Key issues to review None

    @matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label Jun 18, 2024
    Copy link

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    PR Code Suggestions ✨

    No code suggestions found for PR.

    @mergify mergify bot merged commit d3f0c31 into matrixorigin:main Jun 18, 2024
    18 checks passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Bug fix Review effort [1-5]: 2 size/S Denotes a PR that changes [10,99] lines Tests
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants