qfix: begin should correctly handle reselect#1485
Open
denis-tingaikin wants to merge 1 commit into
Open
Conversation
Signed-off-by: denis-tingaikin <denis.tingajkin@xored.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1485 +/- ##
=======================================
Coverage ? 70.38%
=======================================
Files ? 248
Lines ? 11197
Branches ? 0
=======================================
Hits ? 7881
Misses ? 2815
Partials ? 501 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
68262cf to
35600c5
Compare
| if closeErr != nil { | ||
| log.FromContext(ctx).Errorf("Can't close old connection: %v", closeErr) | ||
| } else { | ||
| request.GetConnection().State = networkservice.State_UP |
Contributor
There was a problem hiding this comment.
I'm not sure if we should set State_UP after closing.
Maybe State_DOWN?
It may also be worth moving eventFactoryServer.state into else block. In this case we can left eventFactoryServer.state == established condition:
if eventFactoryServer.state == established &&
request.GetConnection().GetState() == networkservice.State_RESELECT_REQUESTED &&
eventFactoryServer.request != nil && eventFactoryServer.request.Connection != nil {
log.FromContext(ctx).Info("Closing connection due to RESELECT_REQUESTED state")
_, closeErr := next.Server(withEventFactoryCtx).Close(withEventFactoryCtx, eventFactoryServer.request.Connection)
if closeErr != nil {
log.FromContext(ctx).Errorf("Can't close old connection: %v", closeErr)
} else {
request.GetConnection().State = networkservice.State_DOWN
eventFactoryServer.state = closed
}
}
Member
Author
There was a problem hiding this comment.
- we may lost eventFactoryServer.state == established
- we don't need to request a networkservice with DOWN state if we closed previous connection
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
Issue link
Fixes networkservicemesh/integration-k8s-kind#845
How Has This Been Tested?
Types of changes