Description
xapian index build is broken in 1.9 because self.request.finish is gone.
Component selection
- MoinMoin/search/builtin.py
Details
MoinMoin Version |
1.9 |
OS and Version |
|
Python Version |
|
Server Setup |
|
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
|
Workaround
Discussion
That's a first idea how to fix it.
Method update(self, *args, **kw) inherited from werkzeug.datastructures.UpdateDictMixin
1 diff -r e17387246649 MoinMoin/search/builtin.py
2 --- a/MoinMoin/search/builtin.py Mon Apr 06 12:31:18 2009 +0200
3 +++ b/MoinMoin/search/builtin.py Sun Apr 12 23:13:29 2009 +0200
4 @@ -290,7 +290,7 @@
5 indexThread.join()
6 return func
7
8 - self.request.finish = joinDecorator(self.request.finish)
9 + self.request.session.update = joinDecorator(self.request.session.update)
10 indexThread.start()
11
12 def _index_pages(self, request, files=None, mode='update'):
13 @@ -351,7 +351,7 @@
14 indexThread.join()
15 return func
16
17 - self.request.finish = joinDecorator(self.request.finish)
18 + self.request.session.update = joinDecorator(self.request.session.update)
19 indexThread.start()
20 except:
21 self.lock.release()
Installed, and seems to work, thx. -- MarcelHäfner 2009-04-28 05:28:23
- please explain why this patch is correct
I want to save a page and received an error like : AttributeError: 'AllContext' object has no attribute 'finish after apply this patch I could save the page without an error message. talked with reimar last night about this. if you like I can undo this patch and give some detail error report about my previous error.
2009-04-27T22:00:19 <dreimark> LotekThirteen: you can test my patch for that problem 2009-04-27T22:01:12 <dreimark> LotekThirteen: http://moinmo.in/MoinMoinBugs/1.9_xapian_request.finish
* Investigation into the Finish method from 1.8 showed that it was running right at the end of the run() method of the application
* The reason for this was to ensure that a new thread is started and processing continued. However the thread needs to be joined right at the end
* The finish method was removed in 1.9 so we have re-added the finish method to the context with a dummy method that does nothing.
* The indexing thread can now continue to operate as it did before and the finish method is called at the end of the application run method.
Plan
- Priority:
Assigned to: AndyDawkins
- Status: Fixed