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

[BUG] grpc-transport does not pass along provided deadline option #77

Closed
jcready opened this issue Jan 24, 2021 · 3 comments
Closed

[BUG] grpc-transport does not pass along provided deadline option #77

jcready opened this issue Jan 24, 2021 · 3 comments

Comments

@jcready
Copy link
Contributor

jcready commented Jan 24, 2021

Considering this callOpts part is commented out in each of the call types I assume this was thought about at one point. It is clear from trying to debug this by passing along the full input options parameter that that solution won't work. It seems like picking individual keys out of the passed options is the only way this will work.

const gCall = client.makeUnaryRequest<I, O>(
`/${method.service.typeName}/${method.name}`,
(value: I): Buffer => Buffer.from(method.I.toBinary(value, opt.binaryOptions)),
(value: Buffer): O => method.O.fromBinary(value, opt.binaryOptions),
input,
gMeta,
// callOpts,
(err, value) => {

const gCall = client.makeServerStreamRequest<I, O>(
`/${method.service.typeName}/${method.name}`,
(value: I): Buffer => Buffer.from(method.I.toBinary(value, opt.binaryOptions)),
(value: Buffer): O => method.O.fromBinary(value, opt.binaryOptions),
input,
gMeta,
// callOpts
);

gCall = client.makeClientStreamRequest<I, O>(
`/${method.service.typeName}/${method.name}`,
(value: I): Buffer => Buffer.from(method.I.toBinary(value, opt.binaryOptions)),
(value: Buffer): O => method.O.fromBinary(value, opt.binaryOptions),
gMeta,
// callOpts,
(err, value) => {

timostamm added a commit that referenced this issue Jan 25, 2021
This is work in progress! It is not tested whether the arrival of the deadline is handled properly.
@timostamm timostamm mentioned this issue Jan 25, 2021
16 tasks
@timostamm
Copy link
Owner

Thanks for the report, @jcready.

The deadline property of GrpcOptions is now picked up, see commit.

Not tested yet. Will have a closer look as soon as i find a longer piece of free time.

@timostamm
Copy link
Owner

Released in v2.0.0-alpha.12
Yet to be tested.

@timostamm
Copy link
Owner

Just tested this. Setting the deadline option in the transport CTOR or a method call arg works.

The following error is raised if the deadline is too short:

RpcError: 4 DEADLINE_EXCEEDED: Deadline exceeded
    at ClientDuplexStreamImpl.<anonymous> (/Users/ts/PhpstormProjects/protobuf-ts/packages/grpc-transport/build/commonjs/grpc-transport.js:152:52)

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