flaxsearch / flaxcode

Automatically exported from code.google.com/p/flaxcode
4 stars 1 forks source link

Can't uninstall Flax after indexing has been run #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Install Flax (all the below tested on Mongoose)
2. Open a browser and verify Flax is running
3. Uninstall Flax (it all works and manages to uninstall the service and
delete all the installed files).

4. Install Flax
5. Create a collection and start indexing
6. Either wait until indexing is done, or don't (it doesn't matter)
7. Uninstall Flax
8. Although we can uninstall the service, a hanging startflax.exe process
is left running and until this is killed with TaskManager we can't delete
some of the installed files.

Original issue reported on code.google.com by charliej...@gmail.com on 7 Nov 2007 at 10:40

GoogleCodeExporter commented 9 years ago

Original comment by paul.x.r...@googlemail.com on 7 Nov 2007 at 11:30

GoogleCodeExporter commented 9 years ago
The following patch may help.

Index: indexer.py
===================================================================
--- indexer.py  (revision 657)
+++ indexer.py  (working copy)
@@ -230,6 +230,7 @@
         while True:
             collection, filter_settings = self.inpipe[1].recv()
             self.outpipe[0].send(indexer.do_indexing(collection, filter_settings))
+        processing.process._exit_func() 

     # call do indexing in the remote process, block until return value is sent back

Original comment by boulton.rj@gmail.com on 7 Nov 2007 at 12:49

GoogleCodeExporter commented 9 years ago
For the record the problem is (we think) as follows.

On windows running as a service the cleanup code that should run when python 
shutdown
does not execute. In particular this means that anything registered with the 
atexit
module does not execute as it should.

The processing module registers something with atexit to kill off child 
processes
that are makred as daemonic (c.f. the standard threading module).  So in the 
service
shutdown code we explicitly call this shutdown code. That's fine for the 
immediate
child process(es) of the main process, but we also can (on windows typically 
do) have
 a child process of the child process (the remote filtering process). The indexing
process presumably has the same problem with shutdown code so we need to ensure 
that
all the children, and children of children etc. get cleaned up.

Original comment by paul.x.r...@googlemail.com on 8 Nov 2007 at 5:35

GoogleCodeExporter commented 9 years ago

Original comment by paul.x.r...@googlemail.com on 9 Nov 2007 at 8:07