Stephen Deasey wrote:
> You're using cvs HEAD, right?  (Last change was 8 days ago).
> 
> But you're using nsd/init.tcl from 4.99.1?  There's been quite a few
> changes here. I don't think the current version forces you to use
> nstrace. But if there are specific problems with the way
> initialisation is happening, let us know.

The good news is that I managed to get init.tcl from 4.99.1 to work
(based on your suggestions below). The bad news is that init.tcl 4.99.2
fails whenever nstrace is used:

* For lazyloader=true, server initialization fails.

* For lazyloader=false, initialization seems ok but on first request I
get the usual problems mentioned in a previous thread (I had tried once
to debug those errors but it took me ages and it did not work out in the
end).

> The current version, for example, calls ns_set cleanup as an interp
> trace. It should never be necessary to call this yourself.
> 
> % join [ns_ictl gettraces deallocate] \n
> 
> ns:tcltrace ns_cleanup
> nsdb:releasehandles a:(nil)
> nsproxy:cleanup a:(nil)
> 
> ns_cleanup looks like this:
> 
> proc ns_cleanup {} {
>     ns_cleanupchans;  # Close files
>     ns_cleanupvars;   # Destroy global variables
>     ns_set  cleanup;  # Destroy non-shared sets
>     ns_http cleanup;  # Abort any http requests
>     ns_ictl cleanup;  # Run depreciated 1-shot Ns_TclRegisterDefer's.
> }
> 
> 
> 'deallocate' traces get run when some C code is finished running some
> Tcl code in an interp. Interps are cached per-thread.  So we can see
> from above that set's are per-interp and the interp is cleaned after
> each request.

I have thus removed nstrace.tcl and modified init.tcl from 4.99.1 by
adding the following snippet in the end of the file:

ns_ictl trace allocate ns_init
ns_ictl trace deallocate ns_cleanup

It seems to be working ok. The problem, however, is that I'm not sure if
anything else is still missing (I cannot trust it enough yet to deploy
it). I would prefer mostly if NS was distributed with an alternative
init.tcl (based on the 4.99.1) so that it works for all of us. We would
then just change the initfile parameter.

> Do any of the tests fail for you? Run: make test.
> 
> If you build with --enable-symbols you'll be able to run 'info locals'
> and 'backtrace' in gdb and get some more information.
> 
> 
> Try this:
> 
> ns_section "ns/server/server1/module/nssock"
> ns_param  keepwait 0
> Does it crash immediately (or sooner) than num-threads-requests?

Yes,this fails on the second page request (i.e., the dependent files are
served via a different thread and thus the 40 threads are consumed earlier).

> Try this:
> 
> ns_section "ns/server/server1/module/nssock"
> ns_param  writersize 0
> Does that prevent the crash?

For a while, but it still fails after a number of requests.

Would it be possible to have an alternative init.tcl (based on the one
from 4.99.1) that has all changes applied except nstrace as an interim
solution (until nstrace is updated as described in a previous message by
ZV)?

Let me know if I can be of any help with this.

Best wishes,
Neophytos

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to