|
From: John M. <joh...@jb...> - 2005-01-24 17:41:07
|
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=20 > Sent: Monday, January 24, 2005 10:13 AM > To: 'wra...@li...' > Subject: Anchor file mysteriously getting deleted immediately=20 > upon startup >=20 > [sorry for dup - originally sent this to Help forum; just now=20 > found out that is old and that I should be sending to this=20 > mailing list] >=20 > I am seeing some weird behavior dealing with the anchorfile.=20 > I have my anchorfile set. And under certain conditions, I=20 > have seen it work. For example, if I start in -c console=20 > mode, it works (anchorfile is created and the JVM will die=20 > when I specifically delete it).=20 > =20 > I can see this work when I install the wrapper as an NT=20 > service BUT ONLY if i start the service using the Windows GUI=20 > utility (the Services GUI from Administration tools). If,=20 > however, I start the Windows service via the -t wrapper=20 > option, the JVM starts up fine, but immediately the=20 > anchorfile gets deleted and the wrapper immediately shuts the=20 > JVM down. It is very weird- I have no idea why or who is=20 > deleting that anchor file - but as soon as it gets created=20 > (no more than a second or two delay) that anchor file gets deleted.=20 > =20 > And this only happens if i start the service using the -t.=20 > Again, if I start the service using the Winows Services GUI,=20 > it all works fine.=20 > =20 > See below for my debug log - note the time stamps and see=20 > that the anchorfile gets deleted rather quickly after startup.=20 > =20 > Has anyone seen this behavior, or more importantly, how to fix it?=20 > =20 > ----=20 > INFO | jvm 1 | 2005/01/22 00:53:38 | 00:53:38,567 INFO=20 > [NamingService] Started jnpPort=3D1099, rmiPort=3D1098,=20 > backlog=3D50, bindAddress=3D/0.0.0.0, Client SocketFactory=3Dnull,=20 > Server=20 > SocketFactory=3Dorg.jboss.net.sockets.DefaultSocketFactory@ad093076=20 > STATUS | wrapper | 2005/01/22 00:53:38 | JBoss [abc-dpl] started.=20 > INFO | jvm 1 | 2005/01/22 00:53:40 | 00:53:40,120 INFO=20 > [Server] JBoss (MX MicroKernel) [4.0.0 (build:=20 > CVSTag=3DJBoss_4_0_0 date=3D200412201046)] Started in 2s:604ms=20 > STATUS | wrapper | 2005/01/22 00:53:41 | Anchor file deleted.=20 > Shutting down.=20 > DEBUG | wrapper | 2005/01/22 00:53:41 | wrapperStopProcess(0) called.=20 > DEBUG | wrapper | 2005/01/22 00:53:41 | Sending stop signal to JVM >=20 > FWIW: I set wrapper.anchor.poll_interval to something higher=20 > (15 seconds) and it still behaves as I describe in my first=20 > post. If I start with -t, the JVM stays up for 15 seconds,=20 > but the anchor file is gone almost immediately. So, after the=20 > 15 seconds are up, since the file is gone, the JVM is=20 > shutdown. It looks like as soon as the wrapper spits out the=20 > log "wrapper | <my service name> started.", that's when the=20 > anchor file gets deleted.=20 > =20 > Don't know if any of this helps. I looked at the C code but=20 > nothing jumped out at me as to a possible problem. Should I=20 > write this up as a bug or am I missing something obvious? >=20 |