Remote API (legacy) client sends command to wrong remote API host
Posted: 25 Jun 2019, 17:25
In my small working example to reproduce the bug I have two remote API clients that communicate to 4 remote API servers. The clients connect to the simulation, restart (stop/start) the simulation, print something to two terminals and console of the simulator (via remote API calls). If I do that with two clients a few times, then it might happen that the message belonging to different terminals/hosts appear in the same or wrong terminal/host. I tested this with V-REP 3.5.0 and 3.6.1 rev3 (both have the issue).
Here is the working example to reproduce:
https://drive.google.com/open?id=1u6OW7 ... WpfVJgjSMD
How to reproduce:
Start 4 simulators, one in each terminal
Run this script with arguments "0 1" first:
Observe outputs in the terminals (and simulation). It should print the right output to two different terminals.
Run this script with arguments "2 3":
Observe outputs in the terminals (and simulation). It should print the right output to two different terminals.
Run this script with arguments "0 1":
Observe outputs in the terminals (and simulation). You might have to repeat running "python multiple_sims_debug.py 0 1" and "python multiple_sims_debug.py 2 3" a few times until the issue happens.
ISSUE!
It is now printing to the single terminal (e.g. terminal started with port 19998, offset 1) and nothing to terminal 0 (started with port 19997, offset 0).
In same terminal it prints:
The first line is the issue (it should not print "sim_port_offset 0" in terminal started with port 19998, with sim_port_offset 1).
It also printing to the same V-REP console (GUI).
Here is the working example to reproduce:
https://drive.google.com/open?id=1u6OW7 ... WpfVJgjSMD
How to reproduce:
Start 4 simulators, one in each terminal
Code: Select all
./vrep.sh multiple_remote_api_host_clients.ttt -gREMOTEAPISERVERSERVICE_19997_FALSE_FALSE
./vrep.sh multiple_remote_api_host_clients.ttt -gREMOTEAPISERVERSERVICE_19998_FALSE_FALSE
./vrep.sh multiple_remote_api_host_clients.ttt -gREMOTEAPISERVERSERVICE_19999_FALSE_FALSE
./vrep.sh multiple_remote_api_host_clients.ttt -gREMOTEAPISERVERSERVICE_20000_FALSE_FALSE
Code: Select all
python multiple_sims_debug.py 0 1
Run this script with arguments "2 3":
Code: Select all
python multiple_sims_debug.py 2 3
Run this script with arguments "0 1":
Code: Select all
python multiple_sims_debug.py 0 1
ISSUE!
It is now printing to the single terminal (e.g. terminal started with port 19998, offset 1) and nothing to terminal 0 (started with port 19997, offset 0).
In same terminal it prints:
Code: Select all
Print via API call: sim_port_offset 0?
Print via API call: sim_port_offset 1?
It also printing to the same V-REP console (GUI).