[pywin32-bugs] [ pywin32-Feature Requests-1815734 ] Problems with more than one ISAPI extension.
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2007-10-18 12:32:44
|
Feature Requests item #1815734, was opened at 2007-10-18 15:13 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551957&aid=1815734&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: psimo (psimo) Assigned to: Nobody/Anonymous (nobody) Summary: Problems with more than one ISAPI extension. Initial Comment: If you use more than one ISAPI extension at the same time, then you most probably want one python process per extension to avoid sharing module level global data. The default puts all extensions in the same python process. In Windows 2000 Server Service Pack 4 this can be done by setting AppProtection=_APP_OUTPROC in the VirtualDirParameters. (In Service Pack 2 _only_ AppProtection=_APP_INPROC works for me.) In Windows 2003 Server the AppProtection does nothing as they use AppPools instead. There you want one AppPool per extension to get one python process per extension. I've used the set_app_pool and remove_pool functions below as the PostInstall and PostRemove arguments to my VirtualDirParameters to achieve this. It would be nice if you could add these or similar helper functions to isapi.install. from isapi.install import GetObject, _IIS_OBJECT import pywintypes def create_pool(pool_name): try: pools = GetObject(_IIS_OBJECT+'/AppPools') except pywintypes.com_error: return # There are no pools try: GetObject(_IIS_OBJECT+'/AppPools/'+pool_name) except pywintypes.com_error: # The pool does not exist pool = pools.Create('IIsApplicationPool', pool_name) pool.SetInfo() return pool_name def delete_pool(pool_name): try: pools = GetObject(_IIS_OBJECT+'/AppPools') pools.Delete('IIsApplicationPool', pool_name) except pywintypes.com_error: pass # The pool didn't exist def set_app_pool(params, options, webdir=None): if webdir: if create_pool(pool_name): webdir.AppPoolID = pool_name webdir.SetInfo() def remove_pool(params, options): delete_pool(pool_name) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551957&aid=1815734&group_id=78018 |