-
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
Serialize chain elements #583
Serialize chain elements #583
Conversation
b8d6686
to
a77303e
Compare
a77303e
to
c8f5457
Compare
c8f5457
to
d4ef042
Compare
570d15d
to
b19c7ef
Compare
b19c7ef
to
bd6fe65
Compare
Question: Why are you serializing Close and Request separately for a given Connection Id? Its not what I expected, and you usually have good reasons for such things :) |
Also, you may find this potentially useful: |
They are not being serialized separately - there are 2 different wrappers for the same executor, because after the |
Got it :) |
bd6fe65
to
5583234
Compare
@xzfc Could you take a look at this PR? It seems to me this can be usful for |
09b73a0
to
76ac337
Compare
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.
This version looks better. Added comments.
@@ -141,7 +143,7 @@ func stressTestRequest() *networkservice.NetworkServiceRequest { | |||
} | |||
} | |||
|
|||
func TestTimeoutServer_StressTest_DoubleClose(t *testing.T) { | |||
func TestTimeoutServer_StressTest(t *testing.T) { |
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.
How long is this test running? Note: we should expect 1s for the unit test.
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.
20ms locally.
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.
build and test (ubuntu-latest)
ok github.com/networkservicemesh/sdk/pkg/networkservice/common/serialize 0.896s
build and test (macos-latest)
ok github.com/networkservicemesh/sdk/pkg/networkservice/common/serialize 0.760s
build and test (windows-latest) <-- it is actually very slow for all tests
ok github.com/networkservicemesh/sdk/pkg/networkservice/common/serialize 1.813s
df6242b
to
08cebc5
Compare
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.
LGTM
Signed-off-by: Vladimir Popov <[email protected]>
Signed-off-by: Vladimir Popov <[email protected]>
Signed-off-by: Vladimir Popov <[email protected]>
Signed-off-by: Vladimir Popov <[email protected]>
08cebc5
to
507f2e9
Compare
Signed-off-by: Vladimir Popov <[email protected]>
507f2e9
to
f8a5f54
Compare
type contextKeyType string | ||
|
||
// IExecutor is a serialize.Executor interface type | ||
type IExecutor interface { |
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.
Please lets follow go interface naming convention https://golang.org/doc/effective_go.html#interface-names
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.
Renamed:
IExecutor -> Executor
.Executor() -> .GetExecutor()
Signed-off-by: Vladimir Popov <[email protected]>
d7c9aba
to
3978cab
Compare
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.
Merging...
@edwarnicke Let us know if you have something in mind related to these changes.
…k@master networkservicemesh/sdk#583 networkservicemesh/sdk PR link: networkservicemesh/sdk#583 networkservicemesh/sdk commit message: commit 98deb86e4ee85abd4622882171b79433be93c335 Author: Vladimir Popov <[email protected]> Date: Tue Dec 1 18:10:53 2020 +0700 Serialize chain elements (#583) * Add serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework timeout with serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with RequestExecutor, CloseExecutor Signed-off-by: Vladimir Popov <[email protected]> * Fix race condition issue in serialize Signed-off-by: Vladimir Popov <[email protected]> * Update github.com/edwarnicke/serialize version Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize Signed-off-by: Vladimir Popov <[email protected]> * Fix URL in README Signed-off-by: Vladimir Popov <[email protected]> * Use atomic.AddUint32() instead of uuid.New().Id() Signed-off-by: Vladimir Popov <[email protected]> * Add multiexecutor Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with multi executor Signed-off-by: Vladimir Popov <[email protected]> * Move multi executor to serialize Signed-off-by: Vladimir Popov <[email protected]> * Rename `IExecutor` to `Executor` Signed-off-by: Vladimir Popov <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#583 networkservicemesh/sdk PR link: networkservicemesh/sdk#583 networkservicemesh/sdk commit message: commit 98deb86e4ee85abd4622882171b79433be93c335 Author: Vladimir Popov <[email protected]> Date: Tue Dec 1 18:10:53 2020 +0700 Serialize chain elements (#583) * Add serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework timeout with serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with RequestExecutor, CloseExecutor Signed-off-by: Vladimir Popov <[email protected]> * Fix race condition issue in serialize Signed-off-by: Vladimir Popov <[email protected]> * Update github.com/edwarnicke/serialize version Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize Signed-off-by: Vladimir Popov <[email protected]> * Fix URL in README Signed-off-by: Vladimir Popov <[email protected]> * Use atomic.AddUint32() instead of uuid.New().Id() Signed-off-by: Vladimir Popov <[email protected]> * Add multiexecutor Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with multi executor Signed-off-by: Vladimir Popov <[email protected]> * Move multi executor to serialize Signed-off-by: Vladimir Popov <[email protected]> * Rename `IExecutor` to `Executor` Signed-off-by: Vladimir Popov <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#583 networkservicemesh/sdk PR link: networkservicemesh/sdk#583 networkservicemesh/sdk commit message: commit 98deb86e4ee85abd4622882171b79433be93c335 Author: Vladimir Popov <[email protected]> Date: Tue Dec 1 18:10:53 2020 +0700 Serialize chain elements (#583) * Add serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework timeout with serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with RequestExecutor, CloseExecutor Signed-off-by: Vladimir Popov <[email protected]> * Fix race condition issue in serialize Signed-off-by: Vladimir Popov <[email protected]> * Update github.com/edwarnicke/serialize version Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize Signed-off-by: Vladimir Popov <[email protected]> * Fix URL in README Signed-off-by: Vladimir Popov <[email protected]> * Use atomic.AddUint32() instead of uuid.New().Id() Signed-off-by: Vladimir Popov <[email protected]> * Add multiexecutor Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with multi executor Signed-off-by: Vladimir Popov <[email protected]> * Move multi executor to serialize Signed-off-by: Vladimir Popov <[email protected]> * Rename `IExecutor` to `Executor` Signed-off-by: Vladimir Popov <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#583 networkservicemesh/sdk PR link: networkservicemesh/sdk#583 networkservicemesh/sdk commit message: commit 98deb86e4ee85abd4622882171b79433be93c335 Author: Vladimir Popov <[email protected]> Date: Tue Dec 1 18:10:53 2020 +0700 Serialize chain elements (#583) * Add serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework timeout with serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with RequestExecutor, CloseExecutor Signed-off-by: Vladimir Popov <[email protected]> * Fix race condition issue in serialize Signed-off-by: Vladimir Popov <[email protected]> * Update github.com/edwarnicke/serialize version Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize Signed-off-by: Vladimir Popov <[email protected]> * Fix URL in README Signed-off-by: Vladimir Popov <[email protected]> * Use atomic.AddUint32() instead of uuid.New().Id() Signed-off-by: Vladimir Popov <[email protected]> * Add multiexecutor Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with multi executor Signed-off-by: Vladimir Popov <[email protected]> * Move multi executor to serialize Signed-off-by: Vladimir Popov <[email protected]> * Rename `IExecutor` to `Executor` Signed-off-by: Vladimir Popov <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#583 networkservicemesh/sdk PR link: networkservicemesh/sdk#583 networkservicemesh/sdk commit message: commit 98deb86e4ee85abd4622882171b79433be93c335 Author: Vladimir Popov <[email protected]> Date: Tue Dec 1 18:10:53 2020 +0700 Serialize chain elements (#583) * Add serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework timeout with serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with RequestExecutor, CloseExecutor Signed-off-by: Vladimir Popov <[email protected]> * Fix race condition issue in serialize Signed-off-by: Vladimir Popov <[email protected]> * Update github.com/edwarnicke/serialize version Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize Signed-off-by: Vladimir Popov <[email protected]> * Fix URL in README Signed-off-by: Vladimir Popov <[email protected]> * Use atomic.AddUint32() instead of uuid.New().Id() Signed-off-by: Vladimir Popov <[email protected]> * Add multiexecutor Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with multi executor Signed-off-by: Vladimir Popov <[email protected]> * Move multi executor to serialize Signed-off-by: Vladimir Popov <[email protected]> * Rename `IExecutor` to `Executor` Signed-off-by: Vladimir Popov <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#583 networkservicemesh/sdk PR link: networkservicemesh/sdk#583 networkservicemesh/sdk commit message: commit 98deb86e4ee85abd4622882171b79433be93c335 Author: Vladimir Popov <[email protected]> Date: Tue Dec 1 18:10:53 2020 +0700 Serialize chain elements (#583) * Add serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework timeout with serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with RequestExecutor, CloseExecutor Signed-off-by: Vladimir Popov <[email protected]> * Fix race condition issue in serialize Signed-off-by: Vladimir Popov <[email protected]> * Update github.com/edwarnicke/serialize version Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize Signed-off-by: Vladimir Popov <[email protected]> * Fix URL in README Signed-off-by: Vladimir Popov <[email protected]> * Use atomic.AddUint32() instead of uuid.New().Id() Signed-off-by: Vladimir Popov <[email protected]> * Add multiexecutor Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with multi executor Signed-off-by: Vladimir Popov <[email protected]> * Move multi executor to serialize Signed-off-by: Vladimir Popov <[email protected]> * Rename `IExecutor` to `Executor` Signed-off-by: Vladimir Popov <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#583 networkservicemesh/sdk PR link: networkservicemesh/sdk#583 networkservicemesh/sdk commit message: commit 98deb86e4ee85abd4622882171b79433be93c335 Author: Vladimir Popov <[email protected]> Date: Tue Dec 1 18:10:53 2020 +0700 Serialize chain elements (#583) * Add serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework timeout with serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with RequestExecutor, CloseExecutor Signed-off-by: Vladimir Popov <[email protected]> * Fix race condition issue in serialize Signed-off-by: Vladimir Popov <[email protected]> * Update github.com/edwarnicke/serialize version Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize Signed-off-by: Vladimir Popov <[email protected]> * Fix URL in README Signed-off-by: Vladimir Popov <[email protected]> * Use atomic.AddUint32() instead of uuid.New().Id() Signed-off-by: Vladimir Popov <[email protected]> * Add multiexecutor Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with multi executor Signed-off-by: Vladimir Popov <[email protected]> * Move multi executor to serialize Signed-off-by: Vladimir Popov <[email protected]> * Rename `IExecutor` to `Executor` Signed-off-by: Vladimir Popov <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#583 networkservicemesh/sdk PR link: networkservicemesh/sdk#583 networkservicemesh/sdk commit message: commit 98deb86e4ee85abd4622882171b79433be93c335 Author: Vladimir Popov <[email protected]> Date: Tue Dec 1 18:10:53 2020 +0700 Serialize chain elements (#583) * Add serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework timeout with serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with RequestExecutor, CloseExecutor Signed-off-by: Vladimir Popov <[email protected]> * Fix race condition issue in serialize Signed-off-by: Vladimir Popov <[email protected]> * Update github.com/edwarnicke/serialize version Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize Signed-off-by: Vladimir Popov <[email protected]> * Fix URL in README Signed-off-by: Vladimir Popov <[email protected]> * Use atomic.AddUint32() instead of uuid.New().Id() Signed-off-by: Vladimir Popov <[email protected]> * Add multiexecutor Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with multi executor Signed-off-by: Vladimir Popov <[email protected]> * Move multi executor to serialize Signed-off-by: Vladimir Popov <[email protected]> * Rename `IExecutor` to `Executor` Signed-off-by: Vladimir Popov <[email protected]> Signed-off-by: NSMBot <[email protected]>
* Add serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework timeout with serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with RequestExecutor, CloseExecutor Signed-off-by: Vladimir Popov <[email protected]> * Fix race condition issue in serialize Signed-off-by: Vladimir Popov <[email protected]> * Update github.com/edwarnicke/serialize version Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize Signed-off-by: Vladimir Popov <[email protected]> * Fix URL in README Signed-off-by: Vladimir Popov <[email protected]> * Use atomic.AddUint32() instead of uuid.New().Id() Signed-off-by: Vladimir Popov <[email protected]> * Add multiexecutor Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with multi executor Signed-off-by: Vladimir Popov <[email protected]> * Move multi executor to serialize Signed-off-by: Vladimir Popov <[email protected]> * Rename `IExecutor` to `Executor` Signed-off-by: Vladimir Popov <[email protected]> Signed-off-by: Sergey Ershov <[email protected]>
* Add serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework timeout with serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with RequestExecutor, CloseExecutor Signed-off-by: Vladimir Popov <[email protected]> * Fix race condition issue in serialize Signed-off-by: Vladimir Popov <[email protected]> * Update github.com/edwarnicke/serialize version Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize Signed-off-by: Vladimir Popov <[email protected]> * Fix URL in README Signed-off-by: Vladimir Popov <[email protected]> * Use atomic.AddUint32() instead of uuid.New().Id() Signed-off-by: Vladimir Popov <[email protected]> * Add multiexecutor Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with multi executor Signed-off-by: Vladimir Popov <[email protected]> * Move multi executor to serialize Signed-off-by: Vladimir Popov <[email protected]> * Rename `IExecutor` to `Executor` Signed-off-by: Vladimir Popov <[email protected]> Signed-off-by: Sergey Ershov <[email protected]>
* Add serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework timeout with serialize Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with RequestExecutor, CloseExecutor Signed-off-by: Vladimir Popov <[email protected]> * Fix race condition issue in serialize Signed-off-by: Vladimir Popov <[email protected]> * Update github.com/edwarnicke/serialize version Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize Signed-off-by: Vladimir Popov <[email protected]> * Fix URL in README Signed-off-by: Vladimir Popov <[email protected]> * Use atomic.AddUint32() instead of uuid.New().Id() Signed-off-by: Vladimir Popov <[email protected]> * Add multiexecutor Signed-off-by: Vladimir Popov <[email protected]> * Rework serialize with multi executor Signed-off-by: Vladimir Popov <[email protected]> * Move multi executor to serialize Signed-off-by: Vladimir Popov <[email protected]> * Rename `IExecutor` to `Executor` Signed-off-by: Vladimir Popov <[email protected]> Signed-off-by: Sergey Ershov <[email protected]>
Issue
Request
,Close
events for the sameConnection.ID
should be processed serially in the whole network service chain. At the moment, there is no such convention and so every new chain element should use some internal synchronization to make such thing inside of it. It leads to the multiple times serializing already serialized events but we still need to make such things for all newly created chain elements because there is no guarantee that someone would do this instead of us.Solution
Create single chain element that is responsive for all per-connection events serializing.