-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add forwarder reuse #1232
Merged
denis-tingaikin
merged 69 commits into
networkservicemesh:main
from
NikitaSkrynnik:forwarders-fix
Mar 14, 2022
Merged
Add forwarder reuse #1232
Changes from 68 commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
c5e7b2b
add forwarder matching
NikitaSkrynnik 158bf44
use path index instead of magic number
NikitaSkrynnik 23c70b9
minor fixes for tests
NikitaSkrynnik 5054a60
fix linter issue
NikitaSkrynnik 2d84a44
make samples
NikitaSkrynnik 4b4acb2
fix linter issues
NikitaSkrynnik f6f782d
fix heal tests
NikitaSkrynnik 5f2925c
change iter count
NikitaSkrynnik fcc66a8
fix timeout value
NikitaSkrynnik a82b946
change iter count again
NikitaSkrynnik a0ffe05
change count
NikitaSkrynnik 0fc5ace
increase timeout
NikitaSkrynnik 5565160
apply suggestions
NikitaSkrynnik 8ffcdf8
add debug info
NikitaSkrynnik 208be86
forwarder health check after nsmgr restart
NikitaSkrynnik 55e2195
disable traces
NikitaSkrynnik 195ddfe
cleanup
NikitaSkrynnik ee38b2b
rework health check
NikitaSkrynnik 47a46f4
enable tracing
NikitaSkrynnik b60cf58
disable tracing
NikitaSkrynnik a18802b
increase timeout
NikitaSkrynnik 40d35dc
rework forwarder health check again
NikitaSkrynnik 5d360a2
add simple sleep
NikitaSkrynnik f14fbee
disable tracing
NikitaSkrynnik d472110
increase sleep time
NikitaSkrynnik 65667d1
add healing
NikitaSkrynnik 90e510b
tracing
NikitaSkrynnik 9403600
add delete
NikitaSkrynnik b7500d1
disable race
NikitaSkrynnik 757e328
revert 'add delete' commit
NikitaSkrynnik 1c05aac
enable tracing
NikitaSkrynnik 1c1a40f
add client conn delete
NikitaSkrynnik fbccb29
delete registry restart
NikitaSkrynnik 4b9cec6
test with forwarder health check
NikitaSkrynnik 8fd4ac4
remove health check + increase sleep
NikitaSkrynnik 5efebe9
change iter count
NikitaSkrynnik f742e7f
add forwarder registration
NikitaSkrynnik e5c6519
fix linter issue
NikitaSkrynnik b6c027f
enable all tests
NikitaSkrynnik 65666e5
test with health check again
NikitaSkrynnik cf605e2
run only one test
NikitaSkrynnik f65e776
add forwarder register
NikitaSkrynnik 5ba1a92
test with clientconn delete again
NikitaSkrynnik 69a8dbc
revert last commit
NikitaSkrynnik a619cdc
increase timeout
NikitaSkrynnik 94aa4cd
add log
NikitaSkrynnik d5a5bc1
test with forwarder register again
NikitaSkrynnik 8dbd566
increase forwarder count
NikitaSkrynnik 46e5b59
add race flag + disable tracing
NikitaSkrynnik 388295e
move test to heal_test.go file
NikitaSkrynnik 4f70571
add clientconn.Delete(ctx) again
NikitaSkrynnik d333978
test only local case
NikitaSkrynnik d52e9a2
test with registry restart
NikitaSkrynnik 415daf3
cleanup
NikitaSkrynnik fd0fd61
test retry patch
NikitaSkrynnik 6ecf906
add logs
NikitaSkrynnik 42dadd3
wake CI
NikitaSkrynnik 1eecafb
test with 100 ms
NikitaSkrynnik 1040bfd
test with 1s
NikitaSkrynnik 47cff32
test without retry
NikitaSkrynnik 654a609
add manual forwarder heal
NikitaSkrynnik 8353758
add remote test
NikitaSkrynnik c87bfc0
reduce tryTimeout
NikitaSkrynnik e1daf89
add nse reregistration
NikitaSkrynnik 8c6fc9d
cleanup
NikitaSkrynnik 6d28137
fix linter issue
NikitaSkrynnik 3d4fc28
enable all tests
NikitaSkrynnik 4c2855b
fix linter issue
NikitaSkrynnik c83bf8e
apply suggestions
NikitaSkrynnik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,18 @@ func (d *discoverForwarderServer) Request(ctx context.Context, request *networks | |
return nil, errors.New("no candidates found") | ||
} | ||
|
||
segments := request.Connection.GetPath().GetPathSegments() | ||
datapathForwarder := "" | ||
if pathIndex := int(request.Connection.GetPath().Index); len(segments) > pathIndex+1 { | ||
datapathForwarder = segments[pathIndex+1].Name | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can remove |
||
for i, candidate := range nses { | ||
if candidate.Name == datapathForwarder { | ||
nses[0], nses[i] = nses[i], nses[0] | ||
break | ||
} | ||
} | ||
} | ||
|
||
var candidatesErr = errors.New("all forwarders have failed") | ||
|
||
// TODO: Should we consider about load balancing? | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reuse
nseReg
fields here to register NSE?