ros2 / tutorials

Apache License 2.0
30 stars 11 forks source link

windows python service tutorial crashes #11

Closed Karsten1987 closed 7 years ago

Karsten1987 commented 7 years ago

server: add_two_ints_server_py.exe client: add_two_ints_client_async_py.exe

it looks like the request (or better all 3 of them) is sent, but the server terminates after. The client receives the results but never terminates.

The same behavior occurs with add_two_ints_client_py.exe Tested with windows binary on Windows7

dirk-thomas commented 7 years ago

Not sure I understand this. As comparison on Linux when I start those two I get:

How is the current behavior on Windows different from that?

Karsten1987 commented 7 years ago

If the server is supposed to be shutting down after 3 requests, then the server part may be fine. However, my add_two_ints_client_py.exe never receives an answer.

wjwwood commented 7 years ago

One theory is that the server is sending the responses but exiting the program before the data is sent over the wire. This was another common bug in ROS 1, where someone would publish a message and then exit immediately, but the data would never get there because the program exited before the data was written to the socket.

Why is it not that the server must be killed with ctrl-c and instead the client exits automatically once it receives the responses?

Karsten1987 commented 7 years ago

The current binary build does not work for me: http://ci.ros2.org/view/packaging/job/packaging_windows/444/

Terminal1: add_two_ints_server_py.exe

Terminal2: add_two_ints_client_py.exe

The server never receives any request, and thus the client never a response.

if I trigger the request with add_two_ints_client_async_py.exe the request goes through and I get a response. The program does not terminate correctly, but that may be my windows version.

If I trigger the request with the c++ version it works just fine and the program terminates correctly: add_two_ints_client.exe

Can anybody else confirm this? If not, I am fine with saying it's my Windows :P

mikaelarguedas commented 7 years ago

I think this was a problem on multiple platforms because the server was being shut down before the response made it through. This behavior has been changed to match the one of the c++ example (the server never exits and the clients send requests one by one) in https://github.com/ros2/demos/pull/150. So I'm going to close this.