Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set infinite timeout for local commands #974

Closed
wants to merge 2 commits into from

Conversation

mbrodala
Copy link
Contributor

@mbrodala mbrodala commented Jan 23, 2017

Q A
Bug fix? Yes
New feature? No
BC breaks? No
Deprecations? No
Fixed tickets N/A

Very long running commands (e.g. DB import) can exceed even 5 minutes (see #955) thus switch to an infinite timeout for local commands.

@antonmedv
Copy link
Member

antonmedv commented Jan 23, 2017

Why not runLocally('...', INF)?

@mbrodala
Copy link
Contributor Author

@Elfet Yes, for runLocally() this is possible but not with run() on a localServer().

@antonmedv
Copy link
Member

not with run() on a localServer().
I think we need to fix API and allow to set timeout for this too.

run('...', INF);

@mbrodala
Copy link
Contributor Author

I'd be fine with that too. Notice that Symfony expects null for infinite timeouts, not INF.

@pluseg
Copy link
Contributor

pluseg commented Feb 17, 2017

@Elfet What do you think about null value for infinite timeouts? It blocks the PR.

@antonmedv
Copy link
Member

Null is okay, but i like INF for verbosity. Also i'm thinking about changing run api in v5 to something like this: run('...', $options).
To becable pass timeouts, pty and other option for current run.

@mbrodala
Copy link
Contributor Author

@Elfet Sounds good. How to proceed on this PR? I can rebase to fix the conflicts if you think it makes sense to have this added.

A little more background: with custom tasks you can of course manually pass null to enable infinite timeout, however this is not possible with 3rd party tasks/recipes.

@antonmedv
Copy link
Member

antonmedv commented Feb 20, 2017

I will manually merge this pr later.

however this is not possible with 3rd party tasks/recipes.

This is interesting point, we need found good API for it. What are problems to solve we want?

@mbrodala
Copy link
Contributor Author

@Elfet That won't be easy to fix. We can reconfigure tasks by now but not the function calls (e.g. runLocally()) within those tasks.

@antonmedv
Copy link
Member

Done in #1092

run('...', ['timeout' => null]);
runLocally('...', ['timeout' => null]);

@antonmedv
Copy link
Member

Also i was thinking about renaming runLocally to exec.

@antonmedv antonmedv closed this Mar 13, 2017
@mbrodala
Copy link
Contributor Author

mbrodala commented Mar 13, 2017

@Elfet The change you mentioned does not solve the issue mentioned here: I'd still need to copy the body of all tasks from 3rd party recipes to set the timeout option. Even i these recipes allow me to customize their command options, this can already be achieved with the current API, see add('rsync', ['timeout => N]);

Thus please reconsider this PR.

@staabm
Copy link
Contributor

staabm commented Mar 13, 2017

Also i was thinking about renaming runLocally to exec.

I like run and runLocally as they cleary communicate their purpose.
exec and run dont make a statement whether they run remotely or locally... this would harm readability

@antonmedv
Copy link
Member

@mbrodala i see, maybe it's should be 3rd party issue? I like simplicity of options in run function. For example, this is how i pass tty to git clone command: ace2889#diff-b4ebd1b9bf76c38d2568949ec0c70c51

Of cause we can add some global param, but i don't like it for some reason.

@mbrodala
Copy link
Contributor Author

You are probably right that the 3rd party recipes should offer options to customize the timeout.

@mbrodala mbrodala deleted the infinite-timeout branch March 13, 2017 10:14
@mbrodala mbrodala restored the infinite-timeout branch March 13, 2017 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants