Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

add timeout support to rosinstall calls #1

@tfoote

Description

@tfoote

https://kforge.ros.org/vcstools/trac/ticket/69

We often have our indexer left hanging on a bad checkout. Sometimes a dropped connection, or server hiccup for which rosinstall just keeps waiting, and the job has to be canceled and restarted.
If we could set a reasonable timeout we'd avoid this problem. This will probably be relatively intrusive in the code flow.

A related problem was dicussed here:
https://code.ros.org/trac/ros/ticket/1780
I think:
We could have something similar to svn --non-interactive
When non-interactive, all SCMs make their commands using --non-interactive options if available
When we run as non-interactive, we also define a timeout on stdout activity.
This also means it should be possible to define a longer timeout than the defaultusing a second option
comment:2 Changed 5 days ago by kruset

However, I just created a change that causes mercurial updates to run without capturing stdout. This might prevent waiting for timeouts on stdout activity.
comment:3 Changed 5 days ago by tfoote

The non-interactive would be good too. But I was more thinking just a pure timeout. The issue we're having in the indexer is that the checkout basically fails part way through.
It looks like calling communicate() in a separate thread is about the best solution: http://stackoverflow.com/questions/1191374/subprocess-with-timeout
Last edited 5 days ago by tfoote (previous) (diff)
comment:4 Changed 4 days ago by kruset

Ok, so this is quite tricky, because we have several requirements.
We want to display the output of commands.
We often want to capture the output of commands as well.
We want to terminate a process properly.
I struggled with calling communicate in a separate thread respecting all of the above, and the code got really messy.
So instead I went for the signal approach, and it seems towork. But I would prefer this to be well code-reviewed. Also I cannot tell whether this runs on windows (or whether it at least runs in the non-timeout case). Attaching patch.
Changed 4 days ago by kruset

attachment timeout.patch added

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions