add DialCustom for overridden runtime behavior#18733
Merged
demmer merged 2 commits intovitessio:mainfrom Oct 14, 2025
Merged
Conversation
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18733 +/- ##
==========================================
- Coverage 67.50% 67.49% -0.01%
==========================================
Files 1605 1605
Lines 263756 263764 +8
==========================================
- Hits 178046 178032 -14
- Misses 85710 85732 +22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Comment on lines
+84
to
+97
| _, err := DialProtocol(context.Background(), protocol, "") | ||
| if err != nil || dialer != "default" { | ||
| t.Fatalf("default dialerFunc should have been called, got %s, err: %v", dialer, err) | ||
| } | ||
|
|
||
| _, err = DialCustom(context.Background(), customDialerFunc, protocol) | ||
| if err != nil || dialer != "custom" { | ||
| t.Fatalf("custom dialerFunc should have been called, got %s, err: %v", dialer, err) | ||
| } | ||
|
|
||
| _, err = DialCustom(context.Background(), customDialerFunc2, protocol) | ||
| if err != nil || dialer != "custom2" { | ||
| t.Fatalf("custom2 dialerFunc should have been called, got %s, err: %v", dialer, err) | ||
| } |
Member
There was a problem hiding this comment.
Minor nitpick, but it would be nice if these tests used require:
Suggested change
| _, err := DialProtocol(context.Background(), protocol, "") | |
| if err != nil || dialer != "default" { | |
| t.Fatalf("default dialerFunc should have been called, got %s, err: %v", dialer, err) | |
| } | |
| _, err = DialCustom(context.Background(), customDialerFunc, protocol) | |
| if err != nil || dialer != "custom" { | |
| t.Fatalf("custom dialerFunc should have been called, got %s, err: %v", dialer, err) | |
| } | |
| _, err = DialCustom(context.Background(), customDialerFunc2, protocol) | |
| if err != nil || dialer != "custom2" { | |
| t.Fatalf("custom2 dialerFunc should have been called, got %s, err: %v", dialer, err) | |
| } | |
| _, err := DialProtocol(context.Background(), protocol, "") | |
| require.NoError(t, err) | |
| require.Equal(t, dialer, "default", "default dialerFunc should have been called") | |
| _, err = DialCustom(context.Background(), customDialerFunc, protocol) | |
| require.NoError(t, err) | |
| require.Equal(t, dialer, "custom", "custom dialerFunc should have been called") | |
| _, err = DialCustom(context.Background(), customDialerFunc2, protocol) | |
| require.NoError(t, err) | |
| require.Equal(t, dialer, "custom2", "custom2 dialerFunc should have been called") |
Member
Author
There was a problem hiding this comment.
Ah much better thanks. Updated.
arthurschreiber
approved these changes
Oct 14, 2025
timvaillancourt
approved these changes
Oct 14, 2025
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
demmer
added a commit
to slackhq/vitess
that referenced
this pull request
Oct 14, 2025
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
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.
Description
Add a new DialCustom hook to the vtgateconn.
We have a case where we want to create a
grpcvtgateconnwith a dynamic dialer to include runtime options, specifically to override the load balancer using the following:Rather than registering this dialer in the global set, we want to instead just invoke the dialer function inline using this newly-added hook:
Related Issue(s)
Checklist
Deployment Notes
AI Disclosure