|
From: Leif M. <le...@ta...> - 2005-02-01 15:58:34
|
John,
Sorry for the slow response, the bill paying demands on my time have
been a bit
overwhelming lately... :-/
Great grasp of the code, that is indeed the problem. A great
example of what
open source is meant to be. :-)
Anyway, I will write it up in your bug as well, but the this is
actually a problem with
the wrapper.pidfile as well as the wrapper.anchorfile. Both will be
deleted on shutdown
if the Wrapper is launched with the -t, -p, -r, or -i commands. None of
which should be
doing so. This was introduced in a recent version when I cleaned up
and centralized
the shutdown code. Oops. I don't usually use the anchor file on
Windows so I had
not noticed this problem.
Anyway, I have put the fix into CVS. As you mentioned, a
workaround is to
specify a dummy anchorfile when using any of the above commands:
Wrapper.exe -t ../conf/wrapper.conf wrapper.anchorfile=dummy
wrapper.pidfile=dummy
Cheers,
Leif
John Mazzitelli wrote:
>OK, so I have more information on this and know the problem - it is a
>bug that I will write up.
>
>When I press the "start" button on MSWindows's Services GUI, the JBoss
>instance starts up fine.
>
>Its only when I issue a wrapper.exe -t will the anchor file come and go
>quickly.
>
>Looking at the code, wrapper_win.c lines 2745-2751, I see the anchor
>file gets created when -c is used. Lines 2777-2785 create the anchor
>file with -s (this is why pressing the start button in the Windows
>Services GUI works).
>
>However, look at the -t - there is no code to write that anchor file.
>This is probably intentional - since I think when you start the wrapper,
>it ends up starting up with "-s" (in other words, the wrapper process
>that starts with -t is a short-lived process - just issues the start
>command and exits - it isn't the "true" wrapper so it should not create
>the anchor).
>
>However, -t still goes through the same exit routine - which means
>appExit() is called (last line in main()). In appExit(), there is the
>unlink to remove the anchor file.
>
>Since -s and -c never return, that appExit() isn't called until the
>appropriate time. However, -t exits immediately and thus deletes the
>anchor file (the anchor file is created when the service is started
>(with the -s)).
>
>It's a race condition - the -s wrapper service starts, creates the
>anchor then the -t process, seeing that the service started, exits. But
>it then immediately deletes the anchor file.
>
>I'll write this up as a bug. Somehow, there needs to be a global flag
>to say, "wrapper.exe is exiting, but don't delete the anchor or pid
>files". And appExit() needs to only delete the files if that flag tells
>it to.
>
>Work around is probably to pass in on the command line to wrapper.exe a
>bogus setting for anchorfile (one different than the real anchorfile
>setting in .conf). The -t process should try to delete that bogus file
>(and fail) leaving the real anchor file alone.
>
>
>
>>-----Original Message-----
>>From: John Mazzitelli
>>Sent: Monday, January 24, 2005 10:13 AM
>>To: 'wra...@li...'
>>Subject: Anchor file mysteriously getting deleted immediately
>>upon startup
>>
>>[sorry for dup - originally sent this to Help forum; just now
>>found out that is old and that I should be sending to this
>>mailing list]
>>
>>I am seeing some weird behavior dealing with the anchorfile.
>>I have my anchorfile set. And under certain conditions, I
>>have seen it work. For example, if I start in -c console
>>mode, it works (anchorfile is created and the JVM will die
>>when I specifically delete it).
>>
>>I can see this work when I install the wrapper as an NT
>>service BUT ONLY if i start the service using the Windows GUI
>>utility (the Services GUI from Administration tools). If,
>>however, I start the Windows service via the -t wrapper
>>option, the JVM starts up fine, but immediately the
>>anchorfile gets deleted and the wrapper immediately shuts the
>>JVM down. It is very weird- I have no idea why or who is
>>deleting that anchor file - but as soon as it gets created
>>(no more than a second or two delay) that anchor file gets deleted.
>>
>>And this only happens if i start the service using the -t.
>>Again, if I start the service using the Winows Services GUI,
>>it all works fine.
>>
>>See below for my debug log - note the time stamps and see
>>that the anchorfile gets deleted rather quickly after startup.
>>
>>Has anyone seen this behavior, or more importantly, how to fix it?
>>
>>----
>>INFO | jvm 1 | 2005/01/22 00:53:38 | 00:53:38,567 INFO
>>[NamingService] Started jnpPort=1099, rmiPort=1098,
>>backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null,
>>Server
>>SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
>>STATUS | wrapper | 2005/01/22 00:53:38 | JBoss [abc-dpl] started.
>>INFO | jvm 1 | 2005/01/22 00:53:40 | 00:53:40,120 INFO
>>[Server] JBoss (MX MicroKernel) [4.0.0 (build:
>>CVSTag=JBoss_4_0_0 date=200412201046)] Started in 2s:604ms
>>STATUS | wrapper | 2005/01/22 00:53:41 | Anchor file deleted.
>>Shutting down.
>>DEBUG | wrapper | 2005/01/22 00:53:41 | wrapperStopProcess(0) called.
>>DEBUG | wrapper | 2005/01/22 00:53:41 | Sending stop signal to JVM
>>
>>FWIW: I set wrapper.anchor.poll_interval to something higher
>>(15 seconds) and it still behaves as I describe in my first
>>post. If I start with -t, the JVM stays up for 15 seconds,
>>but the anchor file is gone almost immediately. So, after the
>>15 seconds are up, since the file is gone, the JVM is
>>shutdown. It looks like as soon as the wrapper spits out the
>>log "wrapper | <my service name> started.", that's when the
>>anchor file gets deleted.
>>
>>Don't know if any of this helps. I looked at the C code but
>>nothing jumped out at me as to a possible problem. Should I
>>write this up as a bug or am I missing something obvious?
>>
>>
>>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
>Tool for open source databases. Create drag-&-drop reports. Save time
>by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
>Download a FREE copy at http://www.intelliview.com/go/osdn_nl
>_______________________________________________
>Wrapper-user mailing list
>Wra...@li...
>https://lists.sourceforge.net/lists/listinfo/wrapper-user
>
>
>
|