philote_mdo/general/discipline_server.py:41 declares:
class DisciplineServer(disc.DisciplineService):
DisciplineService (generated stub, philote_mdo/generated/disciplines_pb2_grpc.py:109) is the experimental static API — a collection of @staticmethods wrapping grpc.experimental.unary_unary(...), intended for one-shot calls against a target address without constructing a channel. It is not a servicer base class.
The correct base is DisciplineServiceServicer (disciplines_pb2_grpc.py:39), which is what add_DisciplineServiceServicer_to_server is designed to accept.
Why it currently works
Two things mask it:
add_DisciplineServiceServicer_to_server duck-types the handler lookup — it does getattr(servicer, "GetInfo") etc. rather than checking the type.
DisciplineServer overrides all eight RPC methods itself, so no inherited staticmethod is ever reached.
Note that ExplicitServer and ImplicitServer do mix in the correct ExplicitServiceServicer / ImplicitServiceServicer, so the inconsistency is confined to the base class.
Why it should still be fixed
It is latent rather than active, but it is misleading to read, and it means DisciplineServer does not inherit the UNIMPLEMENTED defaults that a servicer base is supposed to provide — so a subclass that forgets to implement an RPC gets an AttributeError at registration time instead of a clean UNIMPLEMENTED status at call time.
Fix
Change the base to disc.DisciplineServiceServicer and confirm nothing depends on the current MRO. Should be a one-word change plus a test run.
philote_mdo/general/discipline_server.py:41declares:DisciplineService(generated stub,philote_mdo/generated/disciplines_pb2_grpc.py:109) is the experimental static API — a collection of@staticmethods wrappinggrpc.experimental.unary_unary(...), intended for one-shot calls against a target address without constructing a channel. It is not a servicer base class.The correct base is
DisciplineServiceServicer(disciplines_pb2_grpc.py:39), which is whatadd_DisciplineServiceServicer_to_serveris designed to accept.Why it currently works
Two things mask it:
add_DisciplineServiceServicer_to_serverduck-types the handler lookup — it doesgetattr(servicer, "GetInfo")etc. rather than checking the type.DisciplineServeroverrides all eight RPC methods itself, so no inherited staticmethod is ever reached.Note that
ExplicitServerandImplicitServerdo mix in the correctExplicitServiceServicer/ImplicitServiceServicer, so the inconsistency is confined to the base class.Why it should still be fixed
It is latent rather than active, but it is misleading to read, and it means
DisciplineServerdoes not inherit theUNIMPLEMENTEDdefaults that a servicer base is supposed to provide — so a subclass that forgets to implement an RPC gets anAttributeErrorat registration time instead of a cleanUNIMPLEMENTEDstatus at call time.Fix
Change the base to
disc.DisciplineServiceServicerand confirm nothing depends on the current MRO. Should be a one-word change plus a test run.