Skip to content

csharp: a registered gRPC interceptor is not an entry point, so impact calls a change to it local #1489

Closed

Description

@swapnilpaliwal-sd

Symptom

A C# gRPC interceptor, a subclass of Grpc.Core.Interceptors.Interceptor registered with AddGrpc(o => o.Interceptors.Add<T>()), is not an entry point, so impact on its handler says nothing depends on it and the change is local. A hosted service in the same file is a lifecycle entry point. Measured on 0.1.3 at 0df257c; CLI impact and the MCP axiomcode_impact tool agree.

Reproduction

src/Program.cs:

using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Interceptors;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
namespace App.Server;
public class LoggingInterceptor : Interceptor
{
    public override Task<TResponse> UnaryServerHandler<TRequest, TResponse>(TRequest request,
        ServerCallContext context, UnaryServerMethod<TRequest, TResponse> continuation)
        => continuation(request, context);
}
public class Heartbeat : BackgroundService
{
    protected override Task ExecuteAsync(System.Threading.CancellationToken ct) => Task.CompletedTask;
}
public static class Program
{
    public static void Main(string[] args)
    {
        var builder = WebApplication.CreateBuilder(args);
        builder.Services.AddGrpc(o => o.Interceptors.Add<LoggingInterceptor>());
        builder.Services.AddHostedService<Heartbeat>();
        builder.Build().Run();
    }
}

axiomcode impact LoggingInterceptor.UnaryServerHandler prints no entry point, three [alongside] rows and next: nothing resolved depends on it, so the change is local -- read src/Program.cs:9 and edit there. The control impact Heartbeat.ExecuteAsync prints Heartbeat.ExecuteAsync is a lifecycle entry point.

Root cause

graph/csharp/engine/framework-behavior/entry-points.dl:14-34 has rules for main, tests, served routes/rpcs/consumers and hosted services (cs_hosted_base, knobs.dl:204-205) only. No knob or rule names Interceptor or its overridable handlers.

Expected

An override of an Interceptor handler on a registered interceptor is a framework-invoked entry point, so impact does not call a change to it local.

Activity

  1. swapnilpaliwal-sd commented on Sep 28, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Fixed by #1620.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    csharpC#engineResolution / call-graph engine rulesenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions