Commit Graph

410 Commits

Author SHA1 Message Date
Mario Minardi 1aac229321 grpc-js: change signature of MethodDefinition used in ServiceDefinition 2019-10-08 11:34:18 -06:00
Mario Minardi 1d7a7f4700 grpc-js: export additional api in index.ts 2019-10-08 11:33:30 -06:00
murgatroid99 e480a0a686 grpc-js: pick first: remove reference and go idle after disconnect 2019-10-07 13:44:08 -07:00
Michael Lumish 2be82c7770
Merge pull request #1065 from murgatroid99/grpc-js_some_tracers
Add tracing functionality and a few connectivity state tracers
2019-10-04 14:27:54 -07:00
murgatroid99 f40d6a61c0 Pick first: go IDLE if all subchannels go IDLE 2019-10-04 10:52:34 -07:00
murgatroid99 81a1aa17b2 Add tracing functionality and a few connectivity state tracers 2019-10-04 10:24:04 -07:00
murgatroid99 781b13573f Add round robin load balancer implementation 2019-10-03 15:17:07 -07:00
murgatroid99 a23f739e5f grpc-js: exitIdle asynchronously in QueuePicker, only act in exitIdle if IDLE 2019-10-02 15:18:40 -07:00
murgatroid99 1b2c558e53 Copy outgoing metadata to avoid modifying it 2019-10-01 10:43:49 -07:00
murgatroid99 4e7f4dff17 Also use original call metadata 2019-09-30 15:56:15 -07:00
murgatroid99 c7d086bfb4 Properly use filtered metadata when starting requests 2019-09-30 15:03:48 -07:00
murgatroid99 ce119ead0b Merge branch 'master' into grpc-js_uds_resolver 2019-09-27 14:24:07 -07:00
murgatroid99 4fb254ddb6 grpc-js: Fix TLS server name handling 2019-09-26 14:32:54 -07:00
murgatroid99 5ab1806b44 Add UDS resolver 2019-09-25 17:53:05 -07:00
Michael Lumish c6b2f423ee
Merge pull request #1045 from murgatroid99/grpc-js_dns_fix
Fix DNS name regex and add tests
2019-09-25 13:43:29 -07:00
Colin Ihrig 79286616d8
grpc-js: fix typo
This commit fixes a typo observed in
https://github.com/grpc/grpc-node/pull/1015
2019-09-24 21:58:01 -04:00
murgatroid99 9238ad07cb Fix DNS name regex and add tests 2019-09-24 18:22:38 -07:00
murgatroid99 adf7b08096 Merge branch 'master' into grpc-js_disconnect_status 2019-09-24 12:11:03 -07:00
murgatroid99 96e3dde23d Return UNAVAILABLE status on TCP disconnect 2019-09-24 10:25:08 -07:00
Michael Lumish b05caec567
Merge branch 'master' into name_resolution_load_balancing 2019-09-23 11:03:25 -07:00
murgatroid99 b003aa14d4 Add function for creating errors from statuses 2019-09-19 17:14:38 -07:00
murgatroid99 9e2aea0399 Revert "Add specific call error for TCP disconnection" 2019-09-19 14:42:40 -07:00
murgatroid99 d762dc4438 Use updated type definitions 2019-09-16 15:37:54 -07:00
murgatroid99 a7a9f0de76 Switch to dns.lookup 2019-09-16 15:12:07 -07:00
Bjorn Stromberg fc032c0226 grpc-js: Update gts and apply fixes 2019-09-13 12:31:33 +09:00
murgatroid99 049da7e058 Add session.socket to ClientHttp2StreamMock in tests 2019-09-06 14:58:42 -07:00
murgatroid99 ae33497656 Check stream.session.socket before adding event handler 2019-09-06 13:21:47 -07:00
murgatroid99 4b4addf5b9 Add specific call error for TCP disconnection 2019-09-06 11:10:47 -07:00
murgatroid99 3f7d640e9e Fix hardcoded IPv6 localhost address 2019-09-03 11:05:54 -07:00
murgatroid99 b7656e0644 Fix DNS result handling, special case localhost, resolve comment 2019-08-30 15:35:34 -07:00
murgatroid99 026d681a84 Fix doubled name resolver errors and added detail 2019-08-29 17:45:06 -07:00
murgatroid99 4144558ee6 Resolve first comments 2019-08-29 17:03:00 -07:00
murgatroid99 889d1d3093 Avoid http2 IPv6 handling bug 2019-08-29 14:11:19 -07:00
murgatroid99 ee4985886d Pick first load balancer: don't connect forever without calls 2019-08-29 10:36:09 -07:00
murgatroid99 b4d848865d Lint fixes 2019-08-28 18:04:43 -07:00
murgatroid99 5aef347fb9 Proceed through pick-first list quickly when subchannel enters TRANSIENT_FAILURE 2019-08-28 17:44:30 -07:00
murgatroid99 01977e6e08 Add documentation and error handling 2019-08-28 17:06:14 -07:00
murgatroid99 fb2e7637c0 Update channel behavior + related classes 2019-08-13 17:58:54 -07:00
murgatroid99 e612cd9934 Add new subchannel and load balancing code 2019-08-13 10:10:50 -07:00
murgatroid99 80d7057cad Use typeof instead of util functions 2019-07-29 13:50:51 -07:00
murgatroid99 acdd2abfc3 Add resolver and service config handling code 2019-07-16 14:35:06 -07:00
murgatroid99 201dab7fa8 Improve server-related types exported by grpc-js 2019-07-16 14:15:55 -07:00
murgatroid99 5b87ceb05c Warn instead of failing when constructing metadata from remote end 2019-07-11 14:43:41 -07:00
murgatroid99 3f460716fb Remove check in grpc-js that doesn't appear in grpc 2019-07-09 10:52:51 -07:00
Tom Kirkpatrick aa54122e51
fix: properly handle http error status codes
fix #941
2019-07-09 00:31:09 +02:00
cjihrig 7c2bb2a237
grpc-js: don't overwrite existing error codes
This commit causes RPC handlers to default to INTERNAL when
an error occurs, but does not overwrite an existing error
code.
2019-06-25 14:04:21 -04:00
cjihrig 00b091a1b1
grpc-js: shutdown improvements
This commit maintains a Set of all active sessions. This allows
tryShutdown() to gracefully stop the server properly (as
recommended in the Node HTTP2 documentation). The same Set of
sessions also allows forceShutdown() to be implemented.
2019-06-25 14:04:21 -04:00
cjihrig 4399131bf9
grpc-js: fix lint
This commit makes the linter pass again.
2019-06-25 13:53:37 -04:00
cjihrig 0b4fd1365a
grpc-js: expose Server implementation publicly
This commit exposes the pure JS Server as public API.
2019-06-25 13:53:37 -04:00
cjihrig c3d7453a84
grpc-js: handle multiple messages in single 'data' event
This commit adds support for receiving multiple messages in a
single 'data' event from the underlying HTTP2 stream. It also
handles potential out of order messages due to asynchronous
deserialization of messages.
2019-06-09 18:12:24 -07:00
Michael Lumish 5b187ba5e8
Merge pull request #908 from murgatroid99/pure_js_goaway_handling
Pure JS: Fixed two bugs with goaway handling
2019-06-07 10:02:13 -07:00
murgatroid99 1ee218c8bd Fix tests for fixed code, also fix another issue 2019-06-06 10:38:28 -07:00
murgatroid99 9aeca2f01a Pure JS: Fixed two bugs with goaway handling 2019-06-06 09:48:04 -07:00
cjihrig 31bcaed6e4
grpc-js: destroy connections when session begins
When the gRPC server has not been started, incoming connections
can be destroyed on session establishment, which happens before
a stream is created.
2019-06-06 09:39:46 -04:00
cjihrig ffe59e6edd
grpc-js: fix lint
This commit gets `npm run lint` passing again.
2019-06-06 09:33:40 -04:00
Michael Lumish 55d6339bca
Merge pull request #902 from cjihrig/bad-content-type
grpc-js: reject invalid Content-Type requests
2019-06-04 15:51:01 -07:00
Michael Lumish f92e2a3a70
Merge pull request #897 from cjihrig/version-string
grpc-js: load semver range from package.json
2019-06-04 12:04:47 -07:00
Michael Lumish 2b1a6756f5
Merge pull request #903 from cjihrig/timeout
grpc-js: disable http2 server timeout
2019-06-04 12:04:32 -07:00
Michael Lumish 70d75a5ab4
Merge pull request #900 from murgatroid99/pure-js_0.4.1_fixes
Fix custom metadata handling bug
2019-06-04 10:50:05 -07:00
cjihrig 93ea51f116
grpc-js: disable http2 server timeout
gRPC has its own mechanisms for timing out a request.
Furthermore, the default timeout was removed from Node.js

Refs: https://github.com/nodejs/node/pull/27558
2019-06-04 12:44:41 -04:00
cjihrig a4b3a7fbae
grpc-js: reject invalid Content-Type requests
This commit implements the following portion of the spec:

If Content-Type does not begin with "application/grpc",
gRPC servers SHOULD respond with HTTP status of
415 (Unsupported Media Type). This will prevent other
HTTP/2 clients from interpreting a gRPC error response,
which uses status 200 (OK), as successful.
2019-06-04 12:02:08 -04:00
murgatroid99 afb7b4a602 Fix dropped messages when multiple arrived in one HTTP/2 frame 2019-06-03 18:21:39 -07:00
murgatroid99 92bed740e8 Fix custom metadata handling bug 2019-06-03 14:47:11 -07:00
Michael Lumish 9c274034d0
Merge pull request #796 from murgatroid99/metadata_options
Add metadata options
2019-06-03 10:48:23 -07:00
cjihrig 69d4377dc2
grpc-js: load semver range from package.json
This commit loads the required semver range from the package.json
file, instead of hard-coding the string in index.ts.
2019-05-31 16:03:59 -04:00
Michael Lumish 5eb17fc559
Merge pull request #887 from murgatroid99/grpc-js_connect_metadata_promise
grpc-js: Change how filters access connectivity information
2019-05-29 09:53:51 -07:00
murgatroid99 45f37f1a9e Fix missing custom metadata 2019-05-28 10:53:08 -07:00
murgatroid99 477c4a4c18 grpc-js: Change how filters access connectivity information 2019-05-28 10:36:07 -07:00
cjihrig f30a5d8588
grpc-js: support client cancellation
This commit adds client cancellation support and tests for
cancellation and deadlines.
2019-05-20 13:38:35 -04:00
cjihrig be6bdb8c3d
grpc-js: update to gts@1.x.x
This commit updates the gts dependency to 1.x.x.
2019-05-17 17:03:04 -04:00
cjihrig a7372e2b1c
grpc-js: slight cleanup of server imports/exports
This commit removes some unnecessary imports and exports
from the server code.
2019-05-17 12:14:27 -04:00
cjihrig 212439eb83
grpc-js: make serdes APIs consistent
During initial implementation, the serialize and deserialize
APIs of ServerReadableStream, ServerWritableStream, and
ServerDuplexStream became inconsistent. This commit brings
back consistency.
2019-05-17 11:40:29 -04:00
cjihrig 1aa11525fd
grpc-js: add bidirectional streaming RPC support
This commit adds bidi streaming RPC support to the server.
2019-05-16 11:23:54 -04:00
cjihrig 4857c63d01
grpc-js: simplify ServerReadableStream's deserialize()
This commit removes null and undefined checks from deserialize().
2019-05-15 09:08:28 -04:00
cjihrig e0a30907f9
grpc-js: add setupReadable() to Http2ServerCallStream
This commit adds a setupReadable() method to
Http2ServerCallStream. This is used to set up the plumbing
between the HTTP2 stream and the surface readable/bidi
calls.
2019-05-14 15:07:12 -04:00
cjihrig b8af8c9474
grpc-js: add client streaming RPC support
This commit adds client streaming RPC support.
2019-05-07 14:23:34 -04:00
cjihrig 7aa45eb55e
grpc-js: extract reusable stream decoding logic
This commit pulls the stream decoding logic into a separate
class so that it can be reused by the server code.
2019-05-06 13:56:23 -04:00
cjihrig 7009d25593
grpc-js: wrestle with typescript handler types
This commit is mindless TypeScript busy work.
2019-05-03 14:49:49 -04:00
cjihrig ec9e82554b
fixup! grpc-js: support unary and server streaming rpcs 2019-05-03 12:21:41 -04:00
cjihrig c050bf5ad8
grpc-js: add sendStatus()
Based on PR feedback, this commit adds a sendStatus() method to
Http2ServerCallStream. All responses will be funnelled through
this method.
2019-05-02 22:18:20 -04:00
cjihrig a6e2edce9a
grpc-js: handle http2 backpressure in server
This commit adds backpressure handling code to the
ServerWritableStream implementation.
2019-05-02 22:18:20 -04:00
cjihrig 79544366be
grpc-js: support unary and server streaming rpcs
This commit adds support for unary and server streaming RPCs.
2019-05-02 21:40:45 -04:00
Alexander Fenster 293ea935f3
grpc-js: add ServiceError 2019-05-02 16:39:01 -07:00
Alexander Fenster fc336307c8 gts fix 2019-05-02 12:56:24 -07:00
Alexander Fenster 6ff835201a
grpc-js: export more types
We (`google-gax`) need these two types exported to switch from C-core gRPC.
2019-05-02 12:53:00 -07:00
Michael Lumish 309033f681
Merge pull request #841 from cjihrig/constant
grpc-js: don't export private symbol
2019-04-29 12:30:07 -07:00
cjihrig 8a183c1f31
grpc-js: rename kChannel symbol
This commit renames the kChannel symbol to follow the repo's
style conventions for constants (although a symbol may not
strictly qualify as a constant).
2019-04-26 19:33:29 -04:00
cjihrig 7ca94b569d
grpc-js: require non-experimental http2
This commit bumps the required semver range to versions of Node
that include a non-experimental http2 module.
2019-04-26 18:53:41 -04:00
cjihrig 406c1d0a97
grpc-js: don't export private symbol
The kChannel symbol was being exported due to a TypeScript
issue. That issue has been resolved, so it seems OK to remove
the export.
2019-04-26 17:54:02 -04:00
cjihrig 62e7f0c85a
grpc-js: define Server API contract
This commit defines the Server API contract, and implements
the Server functionality, minus the actual handling of requests.
2019-04-10 15:35:40 -04:00
cjihrig 1cfe05ba46
grpc-js: update dependency versions
Update grpc-js to the latest version of all dependencies.
2019-04-08 21:00:57 -04:00
cjihrig 40eef7af22
grpc-js: add ServerCredentials support
This commit adds ServerCredentials to the pure JS implementation.
2019-04-01 20:13:24 -04:00
Michael Lumish 3ae5fdd258
Merge pull request #787 from murgatroid99/grpc-js_missing_types
Export missing types, fix a couple of incorrect types
2019-03-25 13:36:59 -07:00
murgatroid99 d4e1672071 JS: Add initial metadata options API compatibility 2019-03-20 15:16:52 -07:00
Nicolas "Pixel" Noble 6bc7184542 Adding missing license on a bunch of source files. 2019-03-19 01:06:57 +01:00
murgatroid99 e0a472d9df Fix lint errors 2019-03-15 12:09:19 -07:00
murgatroid99 c520d5befa Export missing types, fix a couple of incorrect types 2019-03-15 11:32:11 -07:00
Michael Lumish 8704950a5c
Merge pull request #768 from murgatroid99/grpc-js_deadline_filter_promise_finish
grpc-js: deadline filter: reject promise if call ends
2019-03-08 10:01:42 -08:00
murgatroid99 0cf6981eaf Start with http2 sessions unrefed in case no streams are ever created 2019-03-07 15:41:12 -08:00
murgatroid99 b0f06d56c2 Properly remove event listener in other handler 2019-03-07 11:24:22 -08:00
murgatroid99 d77da26021 grpc-js: deadline filter: reject promise if call ends 2019-03-07 11:04:46 -08:00
murgatroid99 030f846c3a grpc-js: call-stream: Don't output messages after status 2019-03-06 17:31:30 -08:00
cjihrig 42126732f5
grpc-js: remove unused EventEmitter interfaces
This commit removes the unused EmitterAugmentation0 and
EmitterAugmentation2 interfaces.
2019-02-27 10:14:25 -05:00
Alexander Fenster b9130b239d fix: use getRequestHeaders if available 2019-01-30 12:18:18 -08:00
murgatroid99 15f877aa45 Fix lint errors 2019-01-14 17:51:41 -08:00
murgatroid99 e32fec18fe grpc-js: Fix handling of non-service objects in package definitions 2019-01-14 17:03:03 -08:00
Tom Kirkpatrick 0997ccaf0f
fix: require package.json directly 2018-11-30 13:53:43 +01:00
cjihrig 65bd142114
grpc-js: rename grpc-js-core to match npm
This commit renames grpc-js-core to grpc-js to more closely
match the name used on npm.
2018-11-01 16:56:57 -04:00
murgatroid99 a0d3d4a22c Remove unused packages 2018-03-23 11:24:56 -07:00
Kelvin Jin ad8aa54fd6 simplify gulp commands in package directories 2017-12-14 16:41:24 -08:00