-
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
Rework memory registry server #699
Rework memory registry server #699
Conversation
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.
Most covered issues related to tests and not related to code of memory chain element.
I guess we could add the unlimited buffers for channels to avoid potential channel deadlocks
OR do not try to send an update if the channel is blocked.
wg.Wait() | ||
} | ||
|
||
func TestNetworkServiceEndpointRegistryServer_SlowReceiver(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.
This test is invalid.
Here is a try to write 100 entries to a channel that has a limited 10 by default. Please look https://github.com/networkservicemesh/sdk/blob/master/pkg/registry/common/memory/common.go#L19
Please use option setChannelSize(100) or
Rework this test to correctly read/write from the channel to simulate the real client/server.
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.
It is actually very similar to the discover
server using watching Find
and finishing receiving after the first match.
findCancel() | ||
} | ||
|
||
func TestNetworkServiceEndpointRegistryServer_ShouldReceiveAllRegisters(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.
Also works fine on master with increasing buffer size inside the 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.
Yes, setting unlimited buffer size fixes almost all found issues :)
wg.Wait() | ||
} | ||
|
||
func TestNetworkServiceEndpointRegistryServer_ShouldReceiveAllUnregisters(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.
Also works fine on master with increasing buffer size inside the test...
9cb9903
to
b362e5c
Compare
3c6b04a
to
c4eb674
Compare
I am not sure that increasing buffer size is an option if we can find a solution without it. |
@Bolodya1997 Do we still have a problem with channel limitation with these changes? |
Nope, there is no more need to add unlimited channels with these changes. |
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
c4eb674
to
1d74a75
Compare
…k@master networkservicemesh/sdk#699 networkservicemesh/sdk PR link: networkservicemesh/sdk#699 networkservicemesh/sdk commit message: commit 536f38f8986817e62259be5f258203006ef96a7e Author: Vladimir Popov <vladimir.popov@xored.com> Date: Wed Feb 10 16:16:43 2021 +0700 Rework memory registry server (#699) * Rework memory registry server Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix memory registry slow receiver test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix tests Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#699 networkservicemesh/sdk PR link: networkservicemesh/sdk#699 networkservicemesh/sdk commit message: commit 536f38f8986817e62259be5f258203006ef96a7e Author: Vladimir Popov <vladimir.popov@xored.com> Date: Wed Feb 10 16:16:43 2021 +0700 Rework memory registry server (#699) * Rework memory registry server Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix memory registry slow receiver test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix tests Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#699 networkservicemesh/sdk PR link: networkservicemesh/sdk#699 networkservicemesh/sdk commit message: commit 536f38f8986817e62259be5f258203006ef96a7e Author: Vladimir Popov <vladimir.popov@xored.com> Date: Wed Feb 10 16:16:43 2021 +0700 Rework memory registry server (#699) * Rework memory registry server Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix memory registry slow receiver test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix tests Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#699 networkservicemesh/sdk PR link: networkservicemesh/sdk#699 networkservicemesh/sdk commit message: commit 536f38f8986817e62259be5f258203006ef96a7e Author: Vladimir Popov <vladimir.popov@xored.com> Date: Wed Feb 10 16:16:43 2021 +0700 Rework memory registry server (#699) * Rework memory registry server Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix memory registry slow receiver test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix tests Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#699 networkservicemesh/sdk PR link: networkservicemesh/sdk#699 networkservicemesh/sdk commit message: commit 536f38f8986817e62259be5f258203006ef96a7e Author: Vladimir Popov <vladimir.popov@xored.com> Date: Wed Feb 10 16:16:43 2021 +0700 Rework memory registry server (#699) * Rework memory registry server Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix memory registry slow receiver test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix tests Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#699 networkservicemesh/sdk PR link: networkservicemesh/sdk#699 networkservicemesh/sdk commit message: commit 536f38f8986817e62259be5f258203006ef96a7e Author: Vladimir Popov <vladimir.popov@xored.com> Date: Wed Feb 10 16:16:43 2021 +0700 Rework memory registry server (#699) * Rework memory registry server Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix memory registry slow receiver test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix tests Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#699 networkservicemesh/sdk PR link: networkservicemesh/sdk#699 networkservicemesh/sdk commit message: commit 536f38f8986817e62259be5f258203006ef96a7e Author: Vladimir Popov <vladimir.popov@xored.com> Date: Wed Feb 10 16:16:43 2021 +0700 Rework memory registry server (#699) * Rework memory registry server Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix memory registry slow receiver test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix tests Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#699 networkservicemesh/sdk PR link: networkservicemesh/sdk#699 networkservicemesh/sdk commit message: commit 536f38f8986817e62259be5f258203006ef96a7e Author: Vladimir Popov <vladimir.popov@xored.com> Date: Wed Feb 10 16:16:43 2021 +0700 Rework memory registry server (#699) * Rework memory registry server Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix memory registry slow receiver test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix tests Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#699 networkservicemesh/sdk PR link: networkservicemesh/sdk#699 networkservicemesh/sdk commit message: commit 536f38f8986817e62259be5f258203006ef96a7e Author: Vladimir Popov <vladimir.popov@xored.com> Date: Wed Feb 10 16:16:43 2021 +0700 Rework memory registry server (#699) * Rework memory registry server Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix memory registry slow receiver test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix tests Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
Issues
There are data races, deadlocks and invalid behavior in both NSE, NS memory registry servers.
Solution