#91 windows service hangs

closed-fixed
WebKit (58)
5
2008-10-10
2008-09-23
Oleg Noga
No

Webware-0.9.4
Webware-1.0rc1
Microsoft Windows server 2003 SP2

Webkit works fine as standalone application.
But when webkit started as service, it hangs sometimes. When trying to stop the service have this exception in event viewer:

The instance's SvcRun() method failed
File "C:\Programs\Python25\lib\site-packages\win32\lib\win32serviceutil.py", line 785, in SvcRun
self.SvcDoRun()
File "C:\Programs\Webware-1.0rc1\WebKit\AppServerService.py", line 226, in SvcDoRun
sys.stdout.flush()
<type 'exceptions.IOError'>: [Errno 9] Bad file descriptor

Thanks!

Discussion

  • Thanks for the bug report, but I cannot reproduce it here on Win XP. Do you have access to Win XP or Vista? Can you reproduce the problem there (I currently cannot access any Win2003 server machine)?

    Other questions: What pywin32 version are you using? Did you change anything in AppServerService.py? If not, a log should be created at C:\Programs\Webware-1.0rc1\WebKit\Logs}webkit.log. Is that location writable, and what is in your log file?

     
  • This bug a

     
  • Oleg Noga
    Oleg Noga
    2008-09-29

    webkit.log

     
    Attachments
  • Oleg Noga
    Oleg Noga
    2008-09-29

    I have no windows vista nearby,
    But it's ok under windows 2000 sp4, windows XP sp2, sp3
    I am using pywin32-210.win32-py2.5.exe
    I have made no changes to AppServerService.py
    webkit.log is writeable by SYSTEM
    webkit.log attached

    As i discovered, log allways finishes on first login.py servet execution from my 'wm' context.
    Reason is that

    reload(sys)

    code executed in static login.py initialization. This resets sys.std* to it's initial values.
    I have fixed this by saving sys.std* in local variable while reloading module.
    Now log is ok and I think that this issue must be gone.

    Thank You for support and sory for not enough investigating before submitting.
    File Added: webkit.log

     
    • assigned_to: nobody --> cito
    • status: open --> closed-fixed
     
  • To avoid the exception, the AppServerService now resets sys.stdout and sys.stderr before shutting down (r7543). But you will still need to save sys.std* for proper logging while the application is running.