client: handle existing IBRL tunnel on reconnect#3066
Closed
martinsander00 wants to merge 2 commits intomainfrom
Closed
client: handle existing IBRL tunnel on reconnect#3066martinsander00 wants to merge 2 commits intomainfrom
martinsander00 wants to merge 2 commits intomainfrom
Conversation
When an IBRL user is already activated onchain and the daemon has a unicast service in memory (e.g. recovered from state file after restart), connect now checks the daemon status before attempting to provision: - BGP Session Up → exit successfully, tunnel is already active - Any other status → return a clear error directing the user to run `doublezero disconnect ibrl` first Previously, the provision call would fail silently and the command would print "✅ User Provisioned" despite the tunnel never being set up.
…y deleted When the onchain user account was deleted before disconnect ran (e.g. in a ban/unban flow where the account is deleted as the unban mechanism), list_user returned no results and controller.remove() was never called, leaving a stale daemon service behind. A subsequent connect ibrl would then hit the "already provisioned" guard and fail. disconnect now falls back to querying the daemon directly via controller.status() and removes any matching stale services when no onchain user is found.
417f215 to
631edfa
Compare
Contributor
Author
|
Handled by #3034 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
doublezero connect ibrlpreviously failed silently when the daemon already had a unicast service in memory (e.g. recovered from the state file after a daemon restart or reboot), printing❌ Error provisioning service: unicast service already provisionedbut then claiming✅ User Provisionedand leaving the user with a broken tunneldoublezero disconnect ibrlfirstdoublezero disconnectnow cleans up stale daemon services even when the onchain user account has already been deleted before disconnect runs (e.g. in a ban/unban flow where the account is deleted as the unban mechanism). Previously, the daemon's tunnel service was silently left behind, causing a subsequentconnect ibrlto fail with "already provisioned" and caused e2eTestE2E_UserBan/user-ban-ibrlto failTesting Verification
test_connect_ibrl_already_active_skips_provision: verifies provisioning is not called when BGP is up (mockall panics on unexpectedprovisioning()call)test_connect_ibrl_stale_tunnel_returns_error: verifies the error message includes the current status and the disconnect command