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

gRPC WatchEvent method with WatchEventRequest_Table_Filter_BEST returns best: false on all paths #2902

Open
roman901 opened this issue Mar 27, 2025 · 1 comment

Comments

@roman901
Copy link

Minimal example code using latest GoBGP and gRPC API:

stream, err := client.WatchEvent(ctx, &pb.WatchEventRequest{
	Table: &pb.WatchEventRequest_Table{
		Filters: []*pb.WatchEventRequest_Table_Filter{
			{
				Type: pb.WatchEventRequest_Table_Filter_BEST,
				Init: true,
			},
		},
	},
})

for {
	r, err := stream.Recv()
	if err == io.EOF {
		break
	} else if err != nil {
		return err
	}

	t := r.GetTable()
	if t == nil {
		continue
	}

	destinations := apiutil.NewDestination(&pb.Destination{Paths: t.Paths})
	for _, path := range destinations.Paths {
		...
	}
}

I expect that path.Best will be true or false, but it is always false.
At the same time ListPath method returns correct values.
Is this bug or planned behavior?

@liuzhenjieabc
Copy link

Is the issue you’re describing the same as the one I encountered? Here are the details of the problem I faced:
I intended to use this interface to capture EVPN Type2 route updates, but after a route update occurs, it triggers two messages:

A WITHDRAW message (Message A) flagged by isWithdraw, which I could filter out.
However, a subsequent UPDATE message (Message B) is generated almost simultaneously. The only difference between Message B and A is the isWithdraw field.
This dual-message behavior causes ambiguity, making it impossible to accurately identify true route update events. The conflict arises because both messages represent the same routing change but with opposite operational flags.

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

No branches or pull requests

2 participants