Universal Robots Forum

Xmlrpc request in thread

I have a problem with xmlrpc request inside a thread.
The thread containing the xmlrpc request can be killed at any moment then restart.
What happen is that last xmlrpc request was not completed when thread was killed and restarted, then a new xmlrpc request occured. It seems that the new request parameter is append to the uncompleted request and the server receive a request with 2 parameters and an error occure.

It occure with our C++ xmlrpc server and I reproduce that with a simple python server.

Here the code to reproduce easily the error:

def bug_thread_xmlrpc():

  linalg = rpc_factory("xmlrpc","http://10.20.7.222:8080")

  thread do_xmlrpc_request():
    while True:
      stdDeviationFx = linalg.std([1,2,3,4,5,6,7,8,9,10])
    end
  end

  while True:
    th = run do_xmlrpc_request()
    sleep(0.5)
    kill th
  end

end

And the python xmlrpc server :

#! /usr/bin/python
from SimpleXMLRPCServer import SimpleXMLRPCServer

def stdDeviation(val):
    print val

server = SimpleXMLRPCServer(("", 8080), allow_none=True)
print "Listening on port 8080..."

server.register_function(stdDeviation, "std")
server.serve_forever()

This is a minimal exemple to reproduce the problem but I can’t prevent this situation to happen.
Do you have any suggestions ?
I already try to create the rpc factory inside thread and to put enter_critical and exit_critical arround the xmlrpc call but nothing change.

thanks

Thank you for providing a great minimal example!

Where does the error occur?
As an error message in PolyScope? In the daemon?

What software version is used?

I obtain same result on these Polyscope versions:

URSoftware 3.8.0.61336
URSoftware 3.9.0.6470
URSoftware 5.2.0.61336
URSoftware 5.3.0.6450

Here is the error


image

This bug has been reported, and moved to Bugs category.

@jbm Do you know when this bug will be resolved? We are having the same issue with our programs. We have been able to replicate as well.

We are still looking into resolving this issue.

@jbm

In the release note of polyscope 5.5.1 it is written :

  • Fixed issue where killed XML-RPC calls with arguments in thread caused wrong arguments

I tested with URsim 5.5.1 and the problem seems solved.
Can you validate that this issue is solve ?