RPC Response Never Hits The Wire

#1

Hi guys,
tl;dr: why is autobahn.twisted.wamp Application periodically failing?

I’ve written a little RPC function in python that registers a method - getAuth(u,p) - against a remote router. It happily handles requests sent to the method on the router … right up until the point that it doesn’t any more.

Desired Data Flow:

Client Router Callee
> > <-- register — |
> > >
> -getAuth(u,p) -> | |
> > -getAuth(u,p) -> |
> > > ------------.
> > > <- process -’
> > <- returnValue - |
> <- returnValue - | |

debug_wamp=True, debug_app=True, and debug=True all point to the following situation:

  • Client requests getAuth(‘example’, ‘123456’) from router
  • Router forwards request to remote Callee
  • Callee receives getAuth(‘example’, ‘123456’) and executes back end code to generate result
  • Callee sets returnValue(result)
  • Callee logs that it is putting octets onto the wire
  • No packet gets sent back to the router
    (tcpdump on the Callee & Router show this flow happening. request into router; forwarded to callee; nothing back)
    I’m stumped. I can’t find a way to see what’s happening in between the Autobahn Application and the OS / network.

So… Could you please provide some advice on diagnosing where the process is failing and how to fix it? Is this a known bug in autobahn.twisted.wamp.Application that has a fix scheduled?

Any advice you can provide would be very much appreciated.

B/r,

Walter Gear

···

-=-=-=-=-
Code extract below:
-=-=-=-=-

additional imports here…

from twisted.internet.defer import inlineCallbacks, returnValue
from autobahn.twisted.wamp import Application
sys.path.append(’.’)
from etc_tools import getAuth

wga = Application() # WAMP Application

@inlineCallbacks
@wga.register(‘com.etc.shadowboard.getAuth’) # register method
def runGetAuth(u, h):
print(‘runGetAuth(’+str(u)+’, ‘+str(h)+’)’) # predebug
r = getAuth(u, h) # do the things
print(‘getAuth() returned…’) # postdebug
print(str®)
yield returnValue® # return result to Router. Eventually fails

wga.run(WAMPROUTER, REALM, start_reactor=True, debug=True, debug_wamp=True, debug_app=True)

``

0 Likes

#2

Hi Walter,

I think one thing you ought to try is not use an AutobahnPython-based router anymore, but use a crossbar.io one. At least that’s the current advice Tobias Oberstein advocates recently.

···

Op woensdag 15 april 2015 04:45:31 UTC+2 schreef Walter Gear:

Hi guys,
tl;dr: why is autobahn.twisted.wamp Application periodically failing?

I’ve written a little RPC function in python that registers a method - getAuth(u,p) - against a remote router. It happily handles requests sent to the method on the router … right up until the point that it doesn’t any more.

Desired Data Flow:

Client Router Callee
> > <-- register — |
> > >
> -getAuth(u,p) -> | |
> > -getAuth(u,p) -> |
> > > ------------.
> > > <- process -’
> > <- returnValue - |
> <- returnValue - | |

debug_wamp=True, debug_app=True, and debug=True all point to the following situation:

  • Client requests getAuth(‘example’, ‘123456’) from router
  • Router forwards request to remote Callee
  • Callee receives getAuth(‘example’, ‘123456’) and executes back end code to generate result
  • Callee sets returnValue(result)
  • Callee logs that it is putting octets onto the wire
  • No packet gets sent back to the router
    (tcpdump on the Callee & Router show this flow happening. request into router; forwarded to callee; nothing back)

additional imports here…

from twisted.internet.defer import inlineCallbacks, returnValue
from autobahn.twisted.wamp import Application
sys.path.append(’.’)
from etc_tools import getAuth

wga = Application() # WAMP Application

@inlineCallbacks
@wga.register(‘com.etc.shadowboard.getAuth’) # register method
def runGetAuth(u, h):
print(‘runGetAuth(’+str(u)+’, ‘+str(h)+’)’) # predebug
r = getAuth(u, h) # do the things
print(‘getAuth() returned…’) # postdebug
print(str®)
yield returnValue® # return result to Router. Eventually fails

wga.run(WAMPROUTER, REALM, start_reactor=True, debug=True, debug_wamp=True, debug_app=True)

``

I’m stumped. I can’t find a way to see what’s happening in between the Autobahn Application and the OS / network.

So… Could you please provide some advice on diagnosing where the process is failing and how to fix it? Is this a known bug in autobahn.twisted.wamp.Application that has a fix scheduled?

Any advice you can provide would be very much appreciated.

B/r,

Walter Gear

-=-=-=-=-
Code extract below:
-=-=-=-=-

0 Likes

#3

Bedankt Roger,

Apologies if I was unclear - the Router is not AutobahnPython-based, it is crossbar.io through and through. The problem is with the Callee / RPC-method-provider that resides on a separate server and is written using autobahn.twisted.wamp.Application.

The crossbar.io Router is working fine, but the Callee seems to periodically stop putting packets back on the wire to the Router (while still logging that all is fine).

If you’ve got any ideas for diagnosing why the octets would not be getting down the stack to the wire, I’d love to hear them.

Thanks in advance,

Met vriendelijke groeten,

W

···

On Thursday, 16 April 2015 00:31:08 UTC+10, Roger Erens wrote:

Hi Walter,

I think one thing you ought to try is not use an AutobahnPython-based router anymore, but use a crossbar.io one. At least that’s the current advice Tobias Oberstein advocates recently.

Op woensdag 15 april 2015 04:45:31 UTC+2 schreef Walter Gear:

Hi guys,
tl;dr: why is autobahn.twisted.wamp Application periodically failing?

I’ve written a little RPC function in python that registers a method - getAuth(u,p) - against a remote router. It happily handles requests sent to the method on the router … right up until the point that it doesn’t any more.

Desired Data Flow:

Client Router Callee
> > <-- register — |
> > >
> -getAuth(u,p) -> | |
> > -getAuth(u,p) -> |
> > > ------------.
> > > <- process -’
> > <- returnValue - |
> <- returnValue - | |

debug_wamp=True, debug_app=True, and debug=True all point to the following situation:

  • Client requests getAuth(‘example’, ‘123456’) from router
  • Router forwards request to remote Callee
  • Callee receives getAuth(‘example’, ‘123456’) and executes back end code to generate result
  • Callee sets returnValue(result)
  • Callee logs that it is putting octets onto the wire
  • No packet gets sent back to the router
    (tcpdump on the Callee & Router show this flow happening. request into router; forwarded to callee; nothing back)

additional imports here…

from twisted.internet.defer import inlineCallbacks, returnValue
from autobahn.twisted.wamp import Application
sys.path.append(’.’)
from etc_tools import getAuth

wga = Application() # WAMP Application

@inlineCallbacks
@wga.register(‘com.etc.shadowboard.getAuth’) # register method
def runGetAuth(u, h):
print(‘runGetAuth(’+str(u)+’, ‘+str(h)+’)’) # predebug
r = getAuth(u, h) # do the things
print(‘getAuth() returned…’) # postdebug
print(str®)
yield returnValue® # return result to Router. Eventually fails

wga.run(WAMPROUTER, REALM, start_reactor=True, debug=True, debug_wamp=True, debug_app=True)

``

I’m stumped. I can’t find a way to see what’s happening in between the Autobahn Application and the OS / network.

So… Could you please provide some advice on diagnosing where the process is failing and how to fix it? Is this a known bug in autobahn.twisted.wamp.Application that has a fix scheduled?

Any advice you can provide would be very much appreciated.

B/r,

Walter Gear

-=-=-=-=-
Code extract below:
-=-=-=-=-

0 Likes

#4

You shouldn’t yield returnValue.
Just call returnValue, the returned Deferred will be resolved by Autobahn automatically.

···

Le mercredi 15 avril 2015 04:45:31 UTC+2, Walter Gear a écrit :

Hi guys,
tl;dr: why is autobahn.twisted.wamp Application periodically failing?

I’ve written a little RPC function in python that registers a method - getAuth(u,p) - against a remote router. It happily handles requests sent to the method on the router … right up until the point that it doesn’t any more.

Desired Data Flow:

Client Router Callee
> > <-- register — |
> > >
> -getAuth(u,p) -> | |
> > -getAuth(u,p) -> |
> > > ------------.
> > > <- process -’
> > <- returnValue - |
> <- returnValue - | |

debug_wamp=True, debug_app=True, and debug=True all point to the following situation:

  • Client requests getAuth(‘example’, ‘123456’) from router
  • Router forwards request to remote Callee
  • Callee receives getAuth(‘example’, ‘123456’) and executes back end code to generate result
  • Callee sets returnValue(result)
  • Callee logs that it is putting octets onto the wire
  • No packet gets sent back to the router
    (tcpdump on the Callee & Router show this flow happening. request into router; forwarded to callee; nothing back)

additional imports here…

from twisted.internet.defer import inlineCallbacks, returnValue
from autobahn.twisted.wamp import Application
sys.path.append(’.’)
from etc_tools import getAuth

wga = Application() # WAMP Application

@inlineCallbacks
@wga.register(‘com.etc.shadowboard.getAuth’) # register method
def runGetAuth(u, h):
print(‘runGetAuth(’+str(u)+’, ‘+str(h)+’)’) # predebug
r = getAuth(u, h) # do the things
print(‘getAuth() returned…’) # postdebug
print(str®)
yield returnValue® # return result to Router. Eventually fails

wga.run(WAMPROUTER, REALM, start_reactor=True, debug=True, debug_wamp=True, debug_app=True)

``

I’m stumped. I can’t find a way to see what’s happening in between the Autobahn Application and the OS / network.

So… Could you please provide some advice on diagnosing where the process is failing and how to fix it? Is this a known bug in autobahn.twisted.wamp.Application that has a fix scheduled?

Any advice you can provide would be very much appreciated.

B/r,

Walter Gear

-=-=-=-=-
Code extract below:
-=-=-=-=-

0 Likes