Forum OpenACS Development: Re: Problem reloading tcl library files from APM

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.
    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.