Forum OpenACS Development: Service Contract: Restart server required

Request notifications

I realized that you have to restart your server whenever you install a binding at /acs-service-contract/.

This is unacceptable at the moment for two reasons:

a) It is not stated so.
b) We should be able to execute the automatic procedure generation that acs-service-contract does in the beginning manually, like reloading procedures in the APM.

I'm willing to fix this, but not sure how.

a) I add a line stating "If you are done with your changes, please restart your server"

b) I add the full procedure generation to the binding-install.tcl, which would reinitialize all procedures whenever I install a new binding.

As I'm not sure about the implications of b), I'm more willing to stick with a) for the time beeing.

Comments ?

Collapse
Posted by Lars Pind on
We looked extensively into making it possible to create new bindings without restarting the server, and it turned out to be really hard. Basically, you have to make sure you create the magic internal proc in all interpreters, which is tricky. Not impossible, just tricky.

It was part of our efforts about a year ago to let you install packages without requiring a restart afterwards, but mimicking what happens during server startup when we're not during server startup anymore is just a tad complicated and error-prone.

So instead: Document it. Include a notice in the UI, and a link to restart the server right away ...

/Lars

Collapse
Posted by Don Baccus on
Why can't the file with the binding be added to the request processor reload list in the same way the APM adds a file that you've requested be reloaded?

That gets it into every thread's interpreter ...

Collapse
Posted by russell muetzelfeldt on
Why can't the file with the binding be added to the request processor reload list in the same way the APM adds a file that you've requested be reloaded?
That gets it into every thread's interpreter ...

Not quite every thread - since apm_load_any_changed_libraries is only called in the request processor, APM watches only work in connection threads (and not in scheduled procs, for example).

Hmmm... Although I guess ad_schedule_proc could be altered to prepend a apm_load_any_changed_libraries to any procs scheduled...

Collapse
Posted by Andrew Piskorski on
Of course the APM request processor reload list thing is still recommended for development use, not production, right? It's always seemed reliable when I've tried it but presumably the performance overhead is significiant?

It's not yet 100% compatible with the usual way of initializing Tcl in AOLserver, but Zoran's recent ttrace work should also provide a different and maybe better way of loading Tcl code into a running AOLserver.

Collapse
Posted by Jonathan Ellis on
naiive question: what's wrong with ns_eval?
Collapse
Posted by Andrew Piskorski on
Good question Jonathan, I don't know.

But, ugh, the current ns_eval docs (dating from early 2002) sure give a very misleading example of how and why to use ns_eval. (Yes you can use it to "maintain global variables", but you sure as heck shouldn't, that's what nsv is for.) Unfortunately this newer draft API doc didn't update that part yet either.

Collapse
Posted by Don Baccus on
ns_eval was broken in AOLserver 4 as of beta8 or so, I have no idea if it ever got fixed properly.  I ripped out the one place we used it previously in OpenACS because of this uncertainty as to whether or not the old semantics would be re-implemented.
Collapse
Posted by Jonathan Ellis on