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

WIP: tentative implementation of restart. #135

Merged
merged 2 commits into from
Dec 12, 2013
Merged

WIP: tentative implementation of restart. #135

merged 2 commits into from
Dec 12, 2013

Conversation

smimram
Copy link
Member

@smimram smimram commented Nov 26, 2013

Simple implementation of the restart command for Liquidsoap. What do you think of it?

It also better declares dependencies between dtools at_stop tasks.

It also better declares dependencies between dtools at_stop tasks.
@smimram smimram mentioned this pull request Nov 26, 2013
@ghost ghost assigned smimram Nov 26, 2013
@smimram
Copy link
Member Author

smimram commented Nov 26, 2013

@dbaelde @toots what do you think of it?

@@ -1307,7 +1314,8 @@ let () =
(fun p ->
let f = List.assoc "" p in
let wrap_f = fun () -> ignore (Lang.apply ~t:Lang.unit_t f []) in
ignore (Dtools.Init.at_stop wrap_f) ;
(* TODO: this could happen after duppy and other threads are shut down, is that ok? *)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't be ok if the function is using things that enqueue stuff. However, enqueueing asynchronous things when shutting down isn't supposed to work anyway..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought so, but just wanted to make sure that everybody agrees on that...

@toots
Copy link
Member

toots commented Nov 26, 2013

Looks fine to me. Let's see what @dbaelde has to say about it..

@dbaelde
Copy link
Member

dbaelde commented Nov 30, 2013

The patch makes sense, but I don't have the details in mind to guess if it's going to work well or not.

Did you try to restart the streaming process without relaunching the binary, ie. call the init functions instead of execv at_stop? This might be even faster, and it might be possible to avoid restarting things such as the logs and the server.

Also regarding the execv, are you sure that Sys.argv is the right array to pass, compared to Shebang.argv? (One thing to test is the restart when liquidsoap is invoked through a shebang.)

@toots, you might have to commit yourself if you want to see Utils.get_some used.

Other than that, the new feature is missing documentation.

@smimram
Copy link
Member Author

smimram commented Dec 12, 2013

The Sys.argv is right since we want to restart liquidsoap exactly as it was started (if there is a shebang it will be reparsed).

I did not try to reinit everything, but I fear that thing will not go on smoothly since we are carying lots of state (but I will try and report).

@smimram
Copy link
Member Author

smimram commented Dec 12, 2013

So, the last comment I think was about the use of execv instead of re-doing the init. I had a look and the init solution would mess the mail.ml code quite a bit, without adding that much feature, so I don't think it's worth it.

@toots @dbaelde I think that its fine now. Do you greenlight a merge?

@dbaelde
Copy link
Member

dbaelde commented Dec 12, 2013

Greenlight here.

smimram added a commit that referenced this pull request Dec 12, 2013
WIP: implementation of restart.
@smimram smimram merged commit 530dacb into master Dec 12, 2013
@smimram smimram deleted the restart branch December 12, 2013 17:03
@jdbuys jdbuys mentioned this pull request Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants