Skip to content
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

Adding stack to errors #1413

Merged

Conversation

wazsone
Copy link
Contributor

@wazsone wazsone commented Jan 24, 2023

Description

Make sure that all errors have a stack and message

Before:

Running tool: /usr/local/go/bin/go test -timeout 30s -run ^TestExcludedPrefixesClient_Close_PrefixesAreRemoved$ github.com/networkservicemesh/sdk/pkg/networkservice/common/excludedprefixes

2023/02/01 06:58:13 [ERROR] [ExcludedPrefixesClient:Request] Source or destination IPs are overlapping with excluded prefixes, srcIPs: [a.16.0.100/32], dstIPs: [b.16.0.103/32], excluded prefixes: [], error: invalid CIDR address: a.16.0.100/32
--- FAIL: TestExcludedPrefixesClient_Close_PrefixesAreRemoved (0.00s)
    /home/ubuntu/nsm/wazsone/sdk/pkg/networkservice/common/excludedprefixes/client_test.go:153: 
        	Error Trace:	/home/ubuntu/nsm/wazsone/sdk/pkg/networkservice/common/excludedprefixes/client_test.go:153
        	Error:      	Received unexpected error:
        	            	invalid CIDR address: a.16.0.100/32
        	Test:       	TestExcludedPrefixesClient_Close_PrefixesAreRemoved
FAIL
FAIL	github.com/networkservicemesh/sdk/pkg/networkservice/common/excludedprefixes	0.016s
FAIL

After:

Running tool: /usr/local/go/bin/go test -timeout 30s -run ^TestExcludedPrefixesClient_Close_PrefixesAreRemoved$ github.com/networkservicemesh/sdk/pkg/networkservice/common/excludedprefixes

2023/02/01 06:59:29 [ERROR] [ExcludedPrefixesClient:Request] Source or destination IPs are overlapping with excluded prefixes, srcIPs: [a.16.0.100/32], dstIPs: [b.16.0.103/32], excluded prefixes: [], error: failed to parse a.16.0.100/32 as CIDR: invalid CIDR address: a.16.0.100/32
--- FAIL: TestExcludedPrefixesClient_Close_PrefixesAreRemoved (0.00s)
    /home/ubuntu/nsm/wazsone/sdk/pkg/networkservice/common/excludedprefixes/client_test.go:153: 
        	Error Trace:	/home/ubuntu/nsm/wazsone/sdk/pkg/networkservice/common/excludedprefixes/client_test.go:153
        	Error:      	Received unexpected error:
        	            	invalid CIDR address: a.16.0.100/32
        	            	failed to parse a.16.0.100/32 as CIDR
        	            	github.com/networkservicemesh/sdk/pkg/networkservice/common/excludedprefixes.validateIPs
        	            		/home/ubuntu/nsm/wazsone/sdk/pkg/networkservice/common/excludedprefixes/client.go:230
        	            	github.com/networkservicemesh/sdk/pkg/networkservice/common/excludedprefixes.(*excludedPrefixesClient).Request
        	            		/home/ubuntu/nsm/wazsone/sdk/pkg/networkservice/common/excludedprefixes/client.go:123
        	            	github.com/networkservicemesh/sdk/pkg/networkservice/common/excludedprefixes_test.TestExcludedPrefixesClient_Close_PrefixesAreRemoved
        	            		/home/ubuntu/nsm/wazsone/sdk/pkg/networkservice/common/excludedprefixes/client_test.go:152
        	            	testing.tRunner
        	            		/usr/local/go/src/testing/testing.go:1439
        	            	runtime.goexit
        	            		/usr/local/go/src/runtime/asm_amd64.s:1571
        	Test:       	TestExcludedPrefixesClient_Close_PrefixesAreRemoved
FAIL
FAIL	github.com/networkservicemesh/sdk/pkg/networkservice/common/excludedprefixes	0.014s
FAIL

Issue link

#705

How Has This Been Tested?

  • Added unit testing to cover
  • Tested manually
  • Tested by integration testing
  • Have not tested

Types of changes

  • Bug fix
  • New functionality
  • Documentation
  • Refactoring
  • CI

@wazsone wazsone force-pushed the feature/adding-errors-stack branch 6 times, most recently from 70ff94a to ef0c48e Compare January 25, 2023 03:35
@wazsone wazsone self-assigned this Jan 25, 2023
@wazsone wazsone changed the title Adding stack to errors Draft: Adding stack to errors Jan 25, 2023
@wazsone wazsone marked this pull request as draft January 25, 2023 07:45
@codecov-commenter
Copy link

codecov-commenter commented Jan 26, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@f45a84e). Click here to learn what that means.
Patch has no changes to coverable lines.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1413   +/-   ##
=======================================
  Coverage        ?   67.60%           
=======================================
  Files           ?      267           
  Lines           ?    11625           
  Branches        ?        0           
=======================================
  Hits            ?     7859           
  Misses          ?     3257           
  Partials        ?      509           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@wazsone wazsone force-pushed the feature/adding-errors-stack branch 2 times, most recently from 17770b7 to 0f5a54f Compare January 26, 2023 11:02
@wazsone wazsone marked this pull request as ready for review January 26, 2023 11:09
@wazsone wazsone changed the title Draft: Adding stack to errors Adding stack to errors Jan 26, 2023
Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
Copy link
Contributor

@glazychev-art glazychev-art left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general it looks good to me.
Left a couple of comments

@@ -1,4 +1,4 @@
// Copyright (c) 2020-2022 Cisco and/or its affiliates.
// Copyright (c) 2020-2023 Cisco and/or its affiliates.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx, done

@@ -47,7 +47,7 @@ func NewMonitorConnectionMonitorConnectionsClient(ctx context.Context, eventCh <
func (m *monitorConnectionMonitorConnectionsClient) Recv() (*networkservice.ConnectionEvent, error) {
select {
case <-m.ctx.Done():
return nil, m.ctx.Err()
return nil, errors.WithStack(m.ctx.Err())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be "application context is done"
(and other places like m.ctx.Err())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, done

@wazsone wazsone force-pushed the feature/adding-errors-stack branch 2 times, most recently from ea64870 to ea1b01f Compare February 2, 2023 11:45
Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
@denis-tingaikin denis-tingaikin merged commit 3aa9aa0 into networkservicemesh:main Feb 13, 2023
nsmbot pushed a commit to networkservicemesh/cmd-admission-webhook-k8s that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-ipam-vl3 that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-cluster-info-k8s that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-map-ip-k8s that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsc-init that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-remote-vlan that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vfio that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr-proxy that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-memory that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-kernel that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-k8s that referenced this pull request Feb 13, 2023
…k@main

PR link: networkservicemesh/sdk#1413

Commit: 3aa9aa0
Author: Ruslan Bayandinov
Date: 2023-02-13 19:45:19 +0600
Message:
  -  Adding stack to errors (#1413)
* adding stack to errors

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update generated files

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/ipam

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/networkservice

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/registry

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update errors handling in pkg/tools

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* update context errors handling

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

* address review comments

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
@glazychev-art glazychev-art mentioned this pull request Aug 1, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants