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

Fix trace diffs #667

Merged

Conversation

glazychev-art
Copy link
Contributor

Fixes: #622

Signed-off-by: Artem Glazychev artem.glazychev@xored.com

Copy link
Member

@denis-tingaikin denis-tingaikin left a comment

Choose a reason for hiding this comment

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

Can we inject into the tail of the servers/clients in chain some element to detect that we achieved the tail?

@@ -28,6 +30,10 @@ import (
// to insure that we never call a method on a nil object
type tailServer struct{}

func newWrappedTailServer(wrapper ServerWrapper) networkservice.NetworkServiceServer {
Copy link
Member

Choose a reason for hiding this comment

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

We should not modify next to fix this issue.
next should not know anything about logging.


func (t *printerClient) Close(ctx context.Context, conn *networkservice.Connection, opts ...grpc.CallOption) (*empty.Empty, error) {
logRequest(ctx, conn)
return next.Client(ctx).Close(ctx, conn, opts...)
Copy link
Member

Choose a reason for hiding this comment

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

Why we do not log response here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think because Close(...) returns protobuf.Empty. There is nothing for logging.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but can we try to log changes in conn?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably you are right.
Do you think there might be the next implementation of Close?

func Close(...) {
	// some code
	r, err := next.Server(ctx).Close(ctx, connection)
	// changes inside connection here
	return r, err
}

@@ -50,8 +64,6 @@ func (t *traceClient) Request(ctx context.Context, request *networkservice.Netwo
ctx, finish := withLog(ctx, operation)
defer finish()

logRequest(ctx, request)
Copy link
Contributor

Choose a reason for hiding this comment

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

You still need to remember current request before it will be modified with traced.
connInfo.Request = proto.Clone(request)

@glazychev-art glazychev-art force-pushed the diff_trace branch 2 times, most recently from 475b305 to c2aa8f8 Compare February 2, 2021 08:16
Comment on lines 58 to 59
&traceClient{traced: traced},
&printerClient{},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
&traceClient{traced: traced},
&printerClient{},
&beginTraceClient{traced: traced},
&endTraceClient{},

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

@denis-tingaikin denis-tingaikin 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 looks good

@glazychev-art glazychev-art marked this pull request as draft February 3, 2021 07:57
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
@glazychev-art glazychev-art marked this pull request as ready for review February 3, 2021 08:21
@denis-tingaikin denis-tingaikin merged commit a11ecd1 into networkservicemesh:master Feb 3, 2021
nsmbot pushed a commit to networkservicemesh/cmd-registry-memory that referenced this pull request Feb 3, 2021
…k@master networkservicemesh/sdk#667

networkservicemesh/sdk PR link: networkservicemesh/sdk#667

networkservicemesh/sdk commit message:
commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc
Author: Artem Glazychev <artem.glazychev@xored.com>
Date:   Wed Feb 3 16:03:22 2021 +0700

    Fix trace diffs (#667)

    Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-icmp-responder that referenced this pull request Feb 3, 2021
…k@master networkservicemesh/sdk#667

networkservicemesh/sdk PR link: networkservicemesh/sdk#667

networkservicemesh/sdk commit message:
commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc
Author: Artem Glazychev <artem.glazychev@xored.com>
Date:   Wed Feb 3 16:03:22 2021 +0700

    Fix trace diffs (#667)

    Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-vpp that referenced this pull request Feb 3, 2021
…k@master networkservicemesh/sdk#667

networkservicemesh/sdk PR link: networkservicemesh/sdk#667

networkservicemesh/sdk commit message:
commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc
Author: Artem Glazychev <artem.glazychev@xored.com>
Date:   Wed Feb 3 16:03:22 2021 +0700

    Fix trace diffs (#667)

    Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vfio that referenced this pull request Feb 3, 2021
…k@master networkservicemesh/sdk#667

networkservicemesh/sdk PR link: networkservicemesh/sdk#667

networkservicemesh/sdk commit message:
commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc
Author: Artem Glazychev <artem.glazychev@xored.com>
Date:   Wed Feb 3 16:03:22 2021 +0700

    Fix trace diffs (#667)

    Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-k8s that referenced this pull request Feb 3, 2021
…k@master networkservicemesh/sdk#667

networkservicemesh/sdk PR link: networkservicemesh/sdk#667

networkservicemesh/sdk commit message:
commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc
Author: Artem Glazychev <artem.glazychev@xored.com>
Date:   Wed Feb 3 16:03:22 2021 +0700

    Fix trace diffs (#667)

    Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr-proxy that referenced this pull request Feb 3, 2021
…k@master networkservicemesh/sdk#667

networkservicemesh/sdk PR link: networkservicemesh/sdk#667

networkservicemesh/sdk commit message:
commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc
Author: Artem Glazychev <artem.glazychev@xored.com>
Date:   Wed Feb 3 16:03:22 2021 +0700

    Fix trace diffs (#667)

    Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-kernel that referenced this pull request Feb 3, 2021
…k@master networkservicemesh/sdk#667

networkservicemesh/sdk PR link: networkservicemesh/sdk#667

networkservicemesh/sdk commit message:
commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc
Author: Artem Glazychev <artem.glazychev@xored.com>
Date:   Wed Feb 3 16:03:22 2021 +0700

    Fix trace diffs (#667)

    Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Feb 3, 2021
…k@master networkservicemesh/sdk#667

networkservicemesh/sdk PR link: networkservicemesh/sdk#667

networkservicemesh/sdk commit message:
commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc
Author: Artem Glazychev <artem.glazychev@xored.com>
Date:   Wed Feb 3 16:03:22 2021 +0700

    Fix trace diffs (#667)

    Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
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.

Traced chain element prints the wrong diff
3 participants