| Author |
Message |
< Yaws mailing list ~ supervising yaws in embedded mode |
| anders_n |
Posted: Sun Apr 27, 2008 2:52 am |
|
|
|
User
Joined: 28 Feb 2005
Posts: 155
Location: Saltillo, Mexico
|
If yaws is started in embedded mode and a yaws process terminates
all the processes are restarted, since yaws_sup is one_for_all.
This means that it is necessary to reinitialize yaws from my application
by calling yaws:start_embedded or yaws_api:setconf.
What is the recommended way of doing this?
I can of course just monitor yaws_server or some other yaws process
but it does not feel right that my app should have to know the
internals of yaws.
/Anders
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Sun Apr 27, 2008 9:04 am |
|
|
|
Guest
|
Anders Nygren wrote:
> If yaws is started in embedded mode and a yaws process terminates
> all the processes are restarted, since yaws_sup is one_for_all.
> This means that it is necessary to reinitialize yaws from my application
> by calling yaws:start_embedded or yaws_api:setconf.
> What is the recommended way of doing this?
>
The idea is that yaws is just an OTP application and you
must add yaws to your set of supervised apps - similar
to all the other applications in your system
/klacke
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist |
|
|
| Back to top |
|
| anders_n |
Posted: Sun Apr 27, 2008 12:01 pm |
|
|
|
User
Joined: 28 Feb 2005
Posts: 155
Location: Saltillo, Mexico
|
On Sun, Apr 27, 2008 at 4:04 AM, Claes Wikstrom <klacke@tail-f.com> wrote:
> Anders Nygren wrote:
>
> > If yaws is started in embedded mode and a yaws process terminates
> > all the processes are restarted, since yaws_sup is one_for_all.
> > This means that it is necessary to reinitialize yaws from my application
> > by calling yaws:start_embedded or yaws_api:setconf.
> > What is the recommended way of doing this?
> >
> >
>
> The idea is that yaws is just an OTP application and you
> must add yaws to your set of supervised apps - similar
> to all the other applications in your system
Claes
I think You missed the point of my question.
I have an app my_app that depends on yaws, so the boot script starts
yaws in embedded mode before starting my_app.
1, during system startup yaws is started in embedded mode. So it is
not listening to any ports and no virtual servers are running
2, since my_app depends on yaws it is started after yaws
3, my_app reads its configuration data, creates the yaws config data and calls
yaws:start_embedded.
4, when start_embedded is called yaws starts the listener(s) and virtual hosts
(yaws_server calls yaws_server:gserv)
At this point everything is working as it should
But when a yaws process terminates
5, All yaws processes are restarted by yaws_sup, this means that the gserv
processes are terminated and not restarted
6, It is necessary for my_app to call yaws:start_embedded again, but
my_app has no
way of knowing that yaws has restarted.
Even if I have yaws as an included application in my_app and I start
yaws_sup from
my_app_sup, I have no way of knowing that yaws has restarted, without adding
a link or monitor from one of my processes to one of the yaws processes.
So I think that maybe the gserv processes should also be in the supervisor tree.
Instead of just linked to from yaws_server.
However that would still not completely solve my problem. Another issue is with
yaws_soap_srv. It is not possible to feed the WSDLs to yaws_soap_srv during
startup. It has to be done by calling yaws_soap_srv:setup. So even though
yaws_soap_srv is restarted by yaws_sup when yaws process terminates, I have
to detect the restart, (and again there is no clean way of doing that), and call
yaws_soap_srv:setup again.
I think we should add a yaws_soap_srv:start_link/1 that makes it possible to
add a list of wsdls in the startup. And a field in gconf or sconf for
this. I think
it should be in sconf, since different virtual hosts can have different WSDLs
If this sounds like a good idea I can make the changes for yaws_soap_srv
but I do not dare to touch the gserv part yet.
/Anders
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist |
|
|
| Back to top |
|
| tobbe |
Posted: Mon Apr 28, 2008 7:08 am |
|
|
|
User
Joined: 19 Jan 2005
Posts: 274
Location: Stockholm, Sweden
|
Anders Nygren wrote:
> On Sun, Apr 27, 2008 at 4:04 AM, Claes Wikstrom <klacke@tail-f.com> wrote:
>> Anders Nygren wrote:
>>
>>> If yaws is started in embedded mode and a yaws process terminates
>>> all the processes are restarted, since yaws_sup is one_for_all.
>>> This means that it is necessary to reinitialize yaws from my application
>>> by calling yaws:start_embedded or yaws_api:setconf.
>>> What is the recommended way of doing this?
>>>
>>>
>> The idea is that yaws is just an OTP application and you
>> must add yaws to your set of supervised apps - similar
>> to all the other applications in your system
>
> Claes
> I think You missed the point of my question.
>
> I have an app my_app that depends on yaws, so the boot script starts
> yaws in embedded mode before starting my_app.
>
> 1, during system startup yaws is started in embedded mode. So it is
> not listening to any ports and no virtual servers are running
>
> 2, since my_app depends on yaws it is started after yaws
>
> 3, my_app reads its configuration data, creates the yaws config data and calls
> yaws:start_embedded.
>
> 4, when start_embedded is called yaws starts the listener(s) and virtual hosts
> (yaws_server calls yaws_server:gserv)
>
> At this point everything is working as it should
>
> But when a yaws process terminates
>
> 5, All yaws processes are restarted by yaws_sup, this means that the gserv
> processes are terminated and not restarted
>
> 6, It is necessary for my_app to call yaws:start_embedded again, but
> my_app has no
> way of knowing that yaws has restarted.
> Even if I have yaws as an included application in my_app and I start
> yaws_sup from
> my_app_sup, I have no way of knowing that yaws has restarted, without adding
> a link or monitor from one of my processes to one of the yaws processes.
>
> So I think that maybe the gserv processes should also be in the supervisor tree.
> Instead of just linked to from yaws_server.
>
> However that would still not completely solve my problem. Another issue is with
> yaws_soap_srv. It is not possible to feed the WSDLs to yaws_soap_srv during
> startup. It has to be done by calling yaws_soap_srv:setup. So even though
> yaws_soap_srv is restarted by yaws_sup when yaws process terminates, I have
> to detect the restart, (and again there is no clean way of doing that), and call
> yaws_soap_srv:setup again.
>
> I think we should add a yaws_soap_srv:start_link/1 that makes it possible to
> add a list of wsdls in the startup. And a field in gconf or sconf for
> this. I think
> it should be in sconf, since different virtual hosts can have different WSDLs
>
> If this sounds like a good idea I can make the changes for yaws_soap_srv
Good idea. Just do it!
(Don't forget to update the docs.)
--Tobbe
> but I do not dare to touch the gserv part yet.
>
> /Anders
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|