Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix error about unimplemented HcpbWorkers call #2361

Merged
merged 2 commits into from
Aug 30, 2022

Conversation

jefferai
Copy link
Member

@jefferai jefferai commented Aug 12, 2022

Although there is a compile time check on the type, it will always
succeed due to the Unimplemented embedding requirement.

As a result, this PR also changes Unimplemented calls to Unsafe calls,
which were added later "for those that prefer their code to break"; the
comments on these state:

// UnsafeXServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to XServiceServer will
// result in compilation errors.

See grpc/grpc-go#4500 (comment)
for some more context.

I think we're fine with compilation errors though; we own both the
server and client side of things and generally are going to add new
methods only when we intend to also add them on the client side.
Notably, what the comment does not indicate is that it will break at
runtime; already it should return a suitable (404 or 405) error if the
client requests a method that does not exist.

@jefferai jefferai added this to the 0.10.2 milestone Aug 12, 2022
@jefferai jefferai requested a review from irenarindos August 12, 2022 21:10
@jefferai jefferai force-pushed the jefferai-uimpl-workers-call branch from 7cab853 to fe6226d Compare August 16, 2022 15:46
Although there is a compile time check on the type, it will always
succeed due to the Unimplemented embedding requirement.

As a result, this PR also changes Unimplemented calls to Unsafe calls,
which were added later "for those that prefer their code to break"; the
comments on these state:

// UnsafeXServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to XServiceServer will
// result in compilation errors.

See grpc/grpc-go#4500 (comment)
for some more context.

I think we're fine with compilation errors though; we own both the
server and client side of things and generally are going to add new
methods only when we intend to also add them on the client side.
Notably, what the comment does not indicate is that it will break at
runtime; already it should return a suitable (404 or 405) error if the
client requests a method that does not exist.
@jefferai jefferai force-pushed the jefferai-uimpl-workers-call branch from fe6226d to e3609ef Compare August 16, 2022 16:04
@jefferai jefferai modified the milestones: 0.10.2, 0.10.3 Aug 17, 2022
@jefferai jefferai merged commit 9b271d7 into main Aug 30, 2022
@jefferai jefferai deleted the jefferai-uimpl-workers-call branch August 30, 2022 18:22
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants