curdling icon indicating copy to clipboard operation
curdling copied to clipboard

`curdling.web.Server` doesn't work in multi-process environment

Open suzaku opened this issue 12 years ago • 5 comments

I'm trying to reuse curdling.web.Server to set up a curdling server in a WSGI app engine:

args = Namespace(curddir=curddir, user_db=None, debug=False)
server = Server(args)

After one of the worker handles an upload, it updates its server.index.storage, while the index.storage of the other workers stay the same.

suzaku avatar Nov 06 '13 00:11 suzaku

Thanks for the report! I'm about to release a new version with improvements in the overall stability of the installer and a handful of other bugs, but I feel like refactoring the indexer will be the thing for the next release.

If you can think of any quicker solution for your problem, we can just take a short path for now and than iterate on the server component in the next release (after refactoring the indexer).

clarete avatar Nov 06 '13 16:11 clarete

@clarete I'm considering making the indexer configurable in the Server class. Then I can use a subclass of Index, storing the storage dict in memcached, which can be accessed across multiple processes and machines.

suzaku avatar Nov 07 '13 00:11 suzaku

@clarete Maybe I'll also need a distributed lock to replace RLock.

suzaku avatar Nov 07 '13 00:11 suzaku

@suzaku Your idea sounds amazing to me. However, I'm still trying to kill some very basic bugs in other areas so I might take a while to be able to work on the server.

The bright side is that I won't even touch that code for a while, which means that you can just go ahead and implement that if you want. I'll certainly be happy to apply the patch.

I can help in one thing or another about tests, since we should definitely start adding the web module to the coverage check.

Thank you for your report and the valuable ideas you gave so far.

clarete avatar Nov 07 '13 17:11 clarete

Just a heads up, you should take a look in our Milestones. I targeted this feature to the version 0.6.0 but I'd certainly be happy to change that milestone if I had someone else working on that.

clarete avatar Nov 07 '13 17:11 clarete