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

Add logs before creating and deleting tap intefaces #849

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pkg/networkservice/mechanisms/kernel/kerneltap/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package kerneltap

import (
"context"
"runtime/debug"
"time"

interfaces "github.com/networkservicemesh/govpp/binapi/interface"
Expand Down Expand Up @@ -77,6 +78,13 @@ func create(ctx context.Context, conn *networkservice.Connection, vppConn api.Co
tapCreate.TapFlags ^= tapv2.TAP_API_FLAG_TUN
}

deadline, ok := ctx.Deadline()
if ok {
timeout := time.Until(deadline)
log.FromContext(ctx).Infof("timeout before creating tap inteface: %v", timeout)
log.FromContext(ctx).Infof("stack trace: %s", string(debug.Stack()))
}

rsp, err := tapv2.NewServiceClient(vppConn).TapCreateV3(ctx, tapCreate)
if err != nil {
return errors.Wrap(err, "vppapi TapCreateV3 returned error")
Expand Down Expand Up @@ -147,6 +155,13 @@ func del(ctx context.Context, conn *networkservice.Connection, vppConn api.Conne
return nil
}
now := time.Now()

deadline, ok := ctx.Deadline()
if ok {
timeout := time.Until(deadline)
log.FromContext(ctx).Infof("timeout before deleting tap inteface: %v", timeout)
log.FromContext(ctx).Infof("stack trace: %s", string(debug.Stack()))
}
_, err := tapv2.NewServiceClient(vppConn).TapDeleteV2(ctx, &tapv2.TapDeleteV2{
SwIfIndex: swIfIndex,
})
Expand Down
Loading