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

[tunnel] Check Route readiness #535

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nkitlabs
Copy link
Contributor

Fixed:

  • check if route is ready before producing a packet (if not deactivate that tunnel)
  • can activate tunnel if the router is ready.

Implementation details

Please ensure the following requirements are met before submitting a pull request:

  • The pull request is targeted against the correct target branch
  • The pull request is linked to an issue with appropriate discussion and an accepted design OR is linked to a spec that describes the work.
  • The pull request includes a description of the implementation/work done in detail.
  • The pull request includes any and all appropriate unit/integration tests
  • You have added a relevant changelog entry to CHANGELOG_UNRELEASED.md
  • You have re-reviewed the files affected by the pull request (e.g. using the Files changed tab in the Github PR explorer)

@nkitlabs nkitlabs requested review from RogerKSI and taobun December 20, 2024 09:20
Comment on lines +294 to +302
case *types.IBCRoute:
portID := PortIDForTunnel(tunnelID)

// retrieve the dynamic capability for this channel
_, found := k.scopedKeeper.GetCapability(
ctx,
host.ChannelCapabilityPath(portID, route.ChannelID),
)
return found
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to check if it's open channel as well? or it's already done that?

Copy link
Contributor

Choose a reason for hiding this comment

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

if yes, need to update on MsgUpdateRoute as well?

Comment on lines +207 to +216
route, err := tunnel.GetRouteValue()
if err != nil {
return err
}

// check whether the router is ready or not
if !k.IsRouteReady(ctx, route, tunnelID) {
return types.ErrRouteNotReady.Wrapf("tunnelID: %d", tunnelID)
}

Copy link
Contributor

@RogerKSI RogerKSI Dec 23, 2024

Choose a reason for hiding this comment

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

move this to above of set active tunnel ID,, prevent state changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants