Hi

My config:

- JServ 1.0 beta 3
- Apache 1.3
- Linux SUSE 6.0 for x86
- JVM/JDK 1.1.7 from the SUSE 6.0 distribution

I'm having troubles with the servlet destruction.  I'm using multiple threads
in my servlet, and during the destroy operation one thread shuts down all
other threads, before finishing the destroy operation. When the master
thread attempts to shutdown the child threads (primarly not using stop()), it
calls the 'join' method with a timeout value.

BTW, I use my own log files with timestamps, so that I exactly know what
happens at which time.

I exactly know that the child thread leaves the 'run' method at some time
and I also exactly know, that the master thread isn't wakened up after
this event, but it's only wakened up after the timeout expires. I have no
explanation for this effect other than the one, that the master thread's
wake-up is delayed due to other threads running (but is it really possible
to delay this for up to 10 seconds?), but surely not by threads for which I am
responsible. Deadlocks due to synchronisation issues don't happen in this case,
so this isn't an explanation.

Once I placed logging statements into my own code, before a Socket.close()
statement and the other one after it (always correctly dealing with the
exceptions which might be caused). During servlet destruction phase, the first
statement was printed to the log file, the other one wasn't, no exception was
thrown. Socket.close() is a non-blocking operation and the logfile wasn't
closed by any other thread. So the thread simply stopped somewhere between,
but it wasn't stopped by any of my threads, nor was the JVM shut down (this is
done about 7-8 seconds later by the jserv module of apache).  So there is a
hole of about 7-8 seconds between the final action inside of JServ and the
killing through the jserv module. It seems as if the JVM process would hang
itself. I can't understand what happens here.

Now I wonder if anyone has experienced similar problems. I never had such
problems when running this code separately, without JServ, as standalone
application, or when using servletrunner.

Another thing I noticed: no messages are printed to the jserv log file for
the whole destruction process (logging basically works during initialization
and for the requests), while my personal logging actions to my private
logfiles work nicely. I looked at the java sources of the JServ and there are
indeed statements which print log messages, so I wonder why they aren't printed?

bye

Sam Jordan


----------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to