Forum OpenACS Development: Problem reloading tcl library files from APM

I have one server (at least) that exhibits strange behavior when reloading tcl library files from the APM.
Sometimes the library is not reloaded in all the tcl interpreters so, if you reload the library and refresh a page in your browser it will sometimes work and sometimes give an error message.

Reloading the tcl library with ns_eval {source path/to/tcl/file} in the developer support shell works every time. (Incidentally this works in servers with performance_mode_p set to 1 also).

Has anyone else experienced this? Overall I think we should replace the reloading code with ns_eval. This works with query files (you can ns_eval {db_qd_load_query_file path/to/query/file} ) and it has the advantage of reloading the library in ALL interpreters including scheduled proc threads.
Anyway I'd still like to understand the problem or know if anyone else has this problem.

we seem to have the same problem...
Collapse
Posted by Gustaf Neumann on
by "all tcl interpreters" i assume you mean the the tcl interpreters of the connection threads. It is a known problem that non-connection threads (e.g. for scheduled operations) are not refreshed. I cannot comment on loading apm files, but there seems to be a confusion sometimes, where it seems that some files are "watched" although only a "reload changed" was issued.

This appears to have the following consequences

  • if one changes a library file of a package and presses "reload changed", no files are detected as new
  • in this state, some connection threads are refreshed, some others are not.

What i do usually in this situation is to do one more edit in the file and press "reload changed" again, until it detects the new files. i am just describing here the symptoms. The problem has not bugged me sufficiently to look into the causes.

In my opinion, the right thing would be to use ns_ictl for blueprint management. This can greatly simplify the code and makes it easier to understand. See e.g.
http://www.mail-archive.com/aolserver@listserv.aol.com/msg08949.html
Note, that "ns_ictl trace alloc ..." requires 4.5

The ns_eval approach might be a quick improvement, but i have seen situations where ns_eval lead to unexpected results (don't ask me for the details). Note, that ns_eval spawns a new thread for every invocation to update the blueprint. Whatever is done, it should be done for all kinds of reloading, the openacs-custom code for reloading should be cleaned out. It would not make sense to issue multiple ns_evals for the same change triggered by the rp.

Collapse
Posted by Dave Bauer on
Thanks Gustaf. It is good to learn that ns_eval spawns a new thread. Definitely we would need to reload all the files in one call to ns_eval instead of an individual call for each file.
Collapse
Posted by Gustaf Neumann on
It might be worse than this: As far as i remember, the current code does a source for every file in every connection thread. So, if one puts simply a ns_eval around the source in a configuration with say 10 connection threads and modifies multiple files, much redundant work will happen.

Of course, i might be wrong, it is a while since i looked at this code.

Collapse
Posted by Dave Bauer on
Gustaf,

Correct, if you just use ns_eval in the current system it will be a problem. I plan on moving the call to ns_eval to the APM so it is only called once when you click "reload"

Hi,

I'm facing the problem in opening the welcome page of openacs in the browezer even though its giving that nssock is listening through so and so port...

I'm installing openacs in debian linux and using oracle database...

even though its accepting the connection, why am i not able to get it in the browser...

its urgent please help...

thanks....