# Xmlrpc request in thread

**URL:** <https://forum.universal-robots.com/t/xmlrpc-request-in-thread/3610>\
**Category:** Technical Questions\
**Tags:** bugs\
**Created:** [February 8, 2019, 9:58pm UTC](https://forum.universal-robots.com/t/xmlrpc-request-in-thread/3610 "2019-02-08T21:58:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![malacasse](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/malacasse/32/56_2.png) [@malacasse](https://forum.universal-robots.com/u/malacasse)\
**Post date:** [February 8, 2019, 9:58pm UTC](https://forum.universal-robots.com/t/xmlrpc-request-in-thread/3610/1 "2019-02-08T21:58:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [February 11, 2019, 8:09am UTC](https://forum.universal-robots.com/t/xmlrpc-request-in-thread/3610/2 "2019-02-11T08:09:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![malacasse](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/malacasse/32/56_2.png) [@malacasse](https://forum.universal-robots.com/u/malacasse)\
**Post date:** [February 11, 2019, 2:13pm UTC](https://forum.universal-robots.com/t/xmlrpc-request-in-thread/3610/3 "2019-02-11T14:13:15Z")

</div>

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](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/c/cca911c05b2c2ae7c26b0c7ccfb9c6b5e0a96b36.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/c/c1c41cb8b1bc66b99c43d98aa3d44726bdf1de68.png)

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [February 11, 2019, 3:10pm UTC](https://forum.universal-robots.com/t/xmlrpc-request-in-thread/3610/5 "2019-02-11T15:10:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [March 25, 2019, 11:54am UTC](https://forum.universal-robots.com/t/xmlrpc-request-in-thread/3610/6 "2019-03-25T11:54:57Z")

</div>

Listed on March 25, 2019, 11:54am UTC



---

<div class="post-metadata">

**Author:** ![mbush](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mbush/32/76_2.png) [@mbush](https://forum.universal-robots.com/u/mbush)\
**Post date:** [April 9, 2019, 9:43pm UTC](https://forum.universal-robots.com/t/xmlrpc-request-in-thread/3610/7 "2019-04-09T21:43:25Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [April 25, 2019, 1:26pm UTC](https://forum.universal-robots.com/t/xmlrpc-request-in-thread/3610/8 "2019-04-25T13:26:40Z")

</div>

We are still looking into resolving this issue.

---

<div class="post-metadata">

**Author:** ![malacasse](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/malacasse/32/56_2.png) [@malacasse](https://forum.universal-robots.com/u/malacasse)\
**Post date:** [October 3, 2019, 4:18pm UTC](https://forum.universal-robots.com/t/xmlrpc-request-in-thread/3610/9 "2019-10-03T16:18:37Z")

</div>

@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 ?
