• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yarpc / yarpc-go / 1494

Build:
DEFAULT BRANCH: master
Ran 19 Aug 2016 01:58AM UTC
Jobs 4
Files 89
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
1494

push

travis-ci

web-flow
Handling of remote timeout (#272)

* Handling of remote timeout

Before this commit, a remote handler that timeouts would return an
unexpected error.

An example when this is a problem:
 - A client starts a request with a timeout of X
 - The remote receives it and runs the remote handler
 - The handler reaches the deadline, and gracefully return a deadline
   error.
 - There is two possible path on the client:
   - The client timeouts itself slightly before receiving the response
     from the server. The user code receives a yarpc timeout error.
   - The client receives the deadline error from the server. The user
     code should receive a timeout error, but was receiving an
     unexpected remote error.

On the HTTP transport, the server returns a 504 with the message "remote
timeout". The client can then build a timeout error using the remote
message as the error message.

On the tchannel transport, the server returns a tchannel timeout error,
with the same message "remote timeout". The timeout error is built like
above.

It is interesting to note that a local timeout (ie, one generated by
tchannel or HTTP on the client side) will have the message "timeout".

Finally, any proxy along the way could also return a timeout error,
likely with a different message.

Programmatically the user code on the client always receives a
TimeoutError, and the error message can be used by humans for analysis.

* introduction of clientTimeout, handlerTimeout and remoteTimeout

A TimeoutError has now 3 implementations:
 - clientTimeout represents a timeout purely on the client side. For
   example the client was waiting after the server and gave up.
 - handlerTimeout is the representation of the timeout of the handler,
   on the server side. It is an HandlerError as well, meaning it can be
   sent trough the transport, and the inbound on the other side has to
   do something about it.
 - remoteTimeout is the representation of a handler timeout on the
   client side. The remote handler returns a handlerTimeout, yarpc
   converts it to a transport timeout error code. Then the inboud
   creates a remoteTimeout from it before returning to the user code.

Additionally, this commit renames all HandlerError implementations from
localFooError to handlerFooError for clarification.

* Test for handler side timeout

For both http and tchannel, a makeshift client verifies that the yarpc
server successfully returns a timeout error when the remote handler
aborts on the context deadline.

* Test for client side interpretation of remote handler timeout (tchannel)

For tchannel, a makeshit server returns a handler timeout. This test
verifies that a yarpc client returns to the user a remote timeout error
behind the TimeoutError interface.

* Test for client side interpretation of remote handler timeout (http)

    For http, a makeshit server returns a handler timeout. This test
    verifies that a yarpc client returns to the user a remote timeout error
    behind the TimeoutError interface.

* Better comments

* lint

* Timeout error functions returns "error" instead of "TimeoutError"

* pr review

* Unit test for handler side timeout for tchannel

Its not possible to test that the handler side trough tchannel returns a
remote timeout error on crossdock. This is at least the "local" unit
test for it.

* Remove flickering crossdock test for tchannel transport handler timeout

* rm extra import

* import reordering

* Regression test against TimeoutError bubbling up.

Timeout should not bubble up.

* try to satify both node and java yarpc weird behavior on empty string or empty object body in json!

* final review

3836 of 4252 relevant lines covered (90.22%)

3.8 hits per line

Jobs
ID Job ID Ran Files Coverage
1 1494.1 19 Aug 2016 02:00AM UTC 0
90.18
Travis Job 1494.1
2 1494.2 19 Aug 2016 01:59AM UTC 0
90.19
Travis Job 1494.2
3 1494.3 19 Aug 2016 01:58AM UTC 0
90.19
Travis Job 1494.3
4 1494.4 19 Aug 2016 02:00AM UTC 0
90.19
Travis Job 1494.4
Source Files on build 1494
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1494
  • 1505af18 on github
  • Prev Build on master (#1482)
  • Next Build on master (#1520)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc