Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

TTransportException Ignored On Service-to-Service Communication #288

Open
pawl opened this issue Mar 21, 2017 · 0 comments
Open

TTransportException Ignored On Service-to-Service Communication #288

pawl opened this issue Mar 21, 2017 · 0 comments

Comments

@pawl
Copy link

pawl commented Mar 21, 2017

Here's the scenario:

  1. Client calls Service A
  2. Service A calls Service B
  3. Service A receives TTransportException while calling Service B (in my example this was because I returned an int instead of the expected string)

Currently you will see a TTransportException on the client that called Service A, but there is no indication in Service A that there was a problem communicating with Service B. This makes for some difficult debugging...

I made a gist illustrating the issue here: https://gist.github.com/pawl/5e1e71e6b9f410d4491fe68c24b9977a

This happens because TThreadedServer swallows the TTransportException here: https://github.com/eleme/thriftpy/blob/v0.3.9/thriftpy/server.py#L96-L97 If you remove that, then all calls will error out, because TTransportException seems to always occur at EOF.

For now, I'm resolving the issue by catching TTransportException where Service A calls Service B and re-raising a different error. However, I still think this is a major gotcha.

Do you think there's a way we can modify thriftpy to prevent this from happening?

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant