List Info

Thread: workbench crashes intermittently on windows with a "ValueError: I/O operation on closed file".




workbench crashes intermittently on windows with a "ValueError: I/O operation on closed file".
user name
2007-11-22 10:50:25
Hi,

I have no idea what causes this,
but the attached patch seems to successfully work around
it.

Carsten.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org
Re: workbench crashes intermittently on windows with a "ValueError: I/O operation on closed file"
user name
2007-12-04 11:34:06
Carsten Koch wrote:
...
> I have no idea what causes this,
> but the attached patch seems to successfully work
around it.

As it turns out, it does not.

Now workbench is crashing with

Traceback (most recent call last):
  File
"M:toolspysvn_workbenchwb_exceptions.py", line
48, in __call__
    self.log.exception( 'TryWrapper<%s.%s>n' %
  File
"C:ProgrammePython24liblogging__init__.py",
line 997, in exception
    apply(self.error, (msg,) + args, {'exc_info': 1})
  File
"C:ProgrammePython24liblogging__init__.py",
line 991, in error
    apply(self._log, (ERROR, msg, args), kwargs)
  File
"C:ProgrammePython24liblogging__init__.py",
line 1068, in _log
    self.handle(record)
  File
"C:ProgrammePython24liblogging__init__.py",
line 1078, in handle
    self.callHandlers(record)
  File
"C:ProgrammePython24liblogging__init__.py",
line 1115, in callHandlers
    hdlr.handle(record)
  File
"C:ProgrammePython24liblogging__init__.py",
line 640, in handle
    self.emit(record)
  File
"/home/icems/tools/pysvn_workbench/wb_app.py",
line 499, in emit
  File
"/home/icems/tools/pysvn_workbench/wb_app.py",
line 481, in doRollover
OSError: [Errno 13] Permission denied

I guess this has something to do with the fact that Windos
cannot handle multiple copies of workbench trying to write
to the same log file.

Barry, do you have any smart idea how to work around this?
How about appending the process ID to the log file name and
removing the log file when workbench is ended normally?
Would that be a good solution?

Carsten.



> 
> Carsten.
> 
> 
>
------------------------------------------------------------
------------
> 
> Subject:
> r51844 - trunk/src/pysvn_workbench
> From:
> Carsten.Kochicem.com
> Date:
> Thu, 22 Nov 2007 17:26:41 +0100 (CET)
> To:
> Carsten.Kochicem.com
> 
> To:
> Carsten.Kochicem.com
> 
> 
> Author: cko
> Date: 2007-11-22 17:26:38 +0100 (Thu, 22 Nov 2007)
> New Revision: 51844
> 
> Modified:
>    trunk/src/pysvn_workbench/wb_app.py
> Log:
> Authorization code commit_mod 3404737589.
> Mod author: cko.
> Mod name: cko-fix_workbench_crash.
> Mod description:
> Workbench crashes occassionally on Windows with
> 
> Traceback (most recent call last):
>   File
"M:toolspysvn_workbenchwb_exceptions.py", line
48, in __call__
>     self.log.exception( 'TryWrapper<%s.%s>n' %
>   File
"C:ProgrammePython24liblogging__init__.py",
line 997, in exception
>     apply(self.error, (msg,) + args, {'exc_info': 1})
>   File
"C:ProgrammePython24liblogging__init__.py",
line 991, in error
>     apply(self._log, (ERROR, msg, args), kwargs)
>   File
"C:ProgrammePython24liblogging__init__.py",
line 1068, in _log
>     self.handle(record)
>   File
"C:ProgrammePython24liblogging__init__.py",
line 1078, in handle
>     self.callHandlers(record)
>   File
"C:ProgrammePython24liblogging__init__.py",
line 1115, in callHandlers
>     hdlr.handle(record)
>   File
"C:ProgrammePython24liblogging__init__.py",
line 640, in handle
>     self.emit(record)
>   File "M:toolspysvn_workbenchwb_app.py",
line 494, in emit
>     self.stream.seek(0, 2)  #due to non-posix-compliant
Windows feature
> ValueError: I/O operation on closed file
> 
> 
> As a workaround, catch the ValueError in wb_app.py.
> This does not fix the real cause of the problem, which
is still unknown.
> 
> Revisions 51694:51698 successfully reviewed by js.
> 
> 
> 
> Modified: trunk/src/pysvn_workbench/wb_app.py
>
============================================================
=======
> --- trunk/src/pysvn_workbench/wb_app.py	2007-11-22
16:24:42 UTC (rev 51843)
> +++ trunk/src/pysvn_workbench/wb_app.py	2007-11-22
16:26:38 UTC (rev 51844)
>  -491,8 +491,11 
>          """
>          if self.maxBytes > 0:                   #
are we rolling over?
>              msg = "%sn" %
self.format(record)
> -            self.stream.seek(0, 2)  #due to
non-posix-compliant Windows feature
> -            if self.stream.tell() + len(msg) >=
self.maxBytes:
> +            try:
> +                self.stream.seek(0, 2)  #due to
non-posix-compliant Windows feature
> +                if self.stream.tell() + len(msg) >=
self.maxBytes:
> +                    self.doRollover()
> +            except ValueError:
>                  self.doRollover()
>          logging.FileHandler.emit(self, record)
>  
> 
> 
> 
> 
> 
>
------------------------------------------------------------
------------
> 
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
> For additional commands, e-mail: dev-helppysvn.tigris.org


-- 
  
___________________________________________________________
  (                                                         
 )
  | Carsten Koch                  Phone: +49-4286-920001    
 |
  | ICEM Technologies GmbH          Fax: +49-4286-1608      
 |
  | Sotheler Mühlenweg 15        mailto:Carsten.Kochicem.com
|
  | 27404 Elsdorf-Hatzte, Germany  http://www.icem.com        |
  | Geschäftsführung: John M. Allen,  HRB 52423             
 |
  | Sitz der Gesellschaft: Hannover,  Ust-ID-Nr: DE
195395237 |
 
(___________________________________________________________
)

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org


Re: workbench crashes intermittently on windows with a "ValueError: I/O operation on closed file"
user name
2007-12-06 14:14:39
Running multiple copies of workbench will createmore
problems then this.
Each copy will think that its allowed to overwrite the
config file.

Would it be better to allow the one copy to create another
windows?

Barry



On Dec 4, 2007, at 17:34, Carsten Koch wrote:

> Carsten Koch wrote:
> ...
>> I have no idea what causes this,
>> but the attached patch seems to successfully work
around it.
>
> As it turns out, it does not.
>
> Now workbench is crashing with
>
> Traceback (most recent call last):
>   File
"M:toolspysvn_workbenchwb_exceptions.py", line
48, in  
> __call__
>     self.log.exception( 'TryWrapper<%s.%s>n' %
>   File
"C:ProgrammePython24liblogging__init__.py",
line 997,  
> in exception
>     apply(self.error, (msg,) + args, {'exc_info': 1})
>   File
"C:ProgrammePython24liblogging__init__.py",
line 991,  
> in error
>     apply(self._log, (ERROR, msg, args), kwargs)
>   File
"C:ProgrammePython24liblogging__init__.py",
line 1068,  
> in _log
>     self.handle(record)
>   File
"C:ProgrammePython24liblogging__init__.py",
line 1078,  
> in handle
>     self.callHandlers(record)
>   File
"C:ProgrammePython24liblogging__init__.py",
line 1115,  
> in callHandlers
>     hdlr.handle(record)
>   File
"C:ProgrammePython24liblogging__init__.py",
line 640,  
> in handle
>     self.emit(record)
>   File
"/home/icems/tools/pysvn_workbench/wb_app.py",
line 499, in  
> emit
>   File
"/home/icems/tools/pysvn_workbench/wb_app.py",
line 481, in  
> doRollover
> OSError: [Errno 13] Permission denied
>
> I guess this has something to do with the fact that
Windos
> cannot handle multiple copies of workbench trying to
write
> to the same log file.
>
> Barry, do you have any smart idea how to work around
this?
> How about appending the process ID to the log file name
and
> removing the log file when workbench is ended
normally?
> Would that be a good solution?
>
> Carsten.
>
>
>
>>
>> Carsten.
>>
>>
>>
------------------------------------------------------------
--------- 
>> ---
>>
>> Subject:
>> r51844 - trunk/src/pysvn_workbench
>> From:
>> Carsten.Kochicem.com
>> Date:
>> Thu, 22 Nov 2007 17:26:41 +0100 (CET)
>> To:
>> Carsten.Kochicem.com
>>
>> To:
>> Carsten.Kochicem.com
>>
>>
>> Author: cko
>> Date: 2007-11-22 17:26:38 +0100 (Thu, 22 Nov 2007)
>> New Revision: 51844
>>
>> Modified:
>>    trunk/src/pysvn_workbench/wb_app.py
>> Log:
>> Authorization code commit_mod 3404737589.
>> Mod author: cko.
>> Mod name: cko-fix_workbench_crash.
>> Mod description:
>> Workbench crashes occassionally on Windows with
>>
>> Traceback (most recent call last):
>>   File
"M:toolspysvn_workbenchwb_exceptions.py", line
48, in  
>> __call__
>>     self.log.exception( 'TryWrapper<%s.%s>n'
%
>>   File
"C:ProgrammePython24liblogging__init__.py",
line 997,  
>> in exception
>>     apply(self.error, (msg,) + args, {'exc_info':
1})
>>   File
"C:ProgrammePython24liblogging__init__.py",
line 991,  
>> in error
>>     apply(self._log, (ERROR, msg, args), kwargs)
>>   File
"C:ProgrammePython24liblogging__init__.py",
line 1068,  
>> in _log
>>     self.handle(record)
>>   File
"C:ProgrammePython24liblogging__init__.py",
line 1078,  
>> in handle
>>     self.callHandlers(record)
>>   File
"C:ProgrammePython24liblogging__init__.py",
line 1115,  
>> in callHandlers
>>     hdlr.handle(record)
>>   File
"C:ProgrammePython24liblogging__init__.py",
line 640,  
>> in handle
>>     self.emit(record)
>>   File
"M:toolspysvn_workbenchwb_app.py", line 494, in
emit
>>     self.stream.seek(0, 2)  #due to
non-posix-compliant Windows  
>> feature
>> ValueError: I/O operation on closed file
>>
>>
>> As a workaround, catch the ValueError in
wb_app.py.
>> This does not fix the real cause of the problem,
which is still  
>> unknown.
>>
>> Revisions 51694:51698 successfully reviewed by js.
>>
>>
>>
>> Modified: trunk/src/pysvn_workbench/wb_app.py
>>
============================================================
=======
>> --- trunk/src/pysvn_workbench/wb_app.py	2007-11-22
16:24:42 UTC  
>> (rev 51843)
>> +++ trunk/src/pysvn_workbench/wb_app.py	2007-11-22
16:26:38 UTC  
>> (rev 51844)
>>  -491,8 +491,11 
>>          """
>>          if self.maxBytes > 0:                  
# are we rolling  
>> over?
>>              msg = "%sn" %
self.format(record)
>> -            self.stream.seek(0, 2)  #due to
non-posix-compliant  
>> Windows feature
>> -            if self.stream.tell() + len(msg) >=
self.maxBytes:
>> +            try:
>> +                self.stream.seek(0, 2)  #due to
non-posix- 
>> compliant Windows feature
>> +                if self.stream.tell() + len(msg)
>= self.maxBytes:
>> +                    self.doRollover()
>> +            except ValueError:
>>                  self.doRollover()
>>          logging.FileHandler.emit(self, record)
>>
>>
>>
>>
>>
>>
>>
------------------------------------------------------------
--------- 
>> ---
>>
>>
------------------------------------------------------------
---------
>> To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
>> For additional commands, e-mail: dev-helppysvn.tigris.org
>
>
> -- 
>   
___________________________________________________________
>   (                                                    
      )
>   | Carsten Koch                  Phone:
+49-4286-920001      |
>   | ICEM Technologies GmbH          Fax: +49-4286-1608 
      |
>   | Sotheler Mühlenweg 15       
mailto:Carsten.Kochicem.com |
>   | 27404 Elsdorf-Hatzte, Germany  http://www.icem.com        |
>   | Geschäftsführung: John M. Allen,  HRB 52423        
      |
>   | Sitz der Gesellschaft: Hannover,  Ust-ID-Nr: DE
195395237 |
>  
(___________________________________________________________
)
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
> For additional commands, e-mail: dev-helppysvn.tigris.org
>
>

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org


Re: workbench crashes intermittently on windows with a "ValueError: I/O operation on closed file"
user name
2007-12-06 14:50:10
Barry Scott wrote:
> Running multiple copies of workbench will createmore
problems then this.
> Each copy will think that its allowed to overwrite the
config file.
> 
> Would it be better to allow the one copy to create
another windows?


Yes, that would of course be very nice.

Is there also an easy way to find out that workbench
is already running when the second copy starts,
open the second window in the first copy and end
the second copy immediately?

If all that is a lot of trouble, I'd go for creating
one log file for each copy and take my chances with
the config file.

Carsten.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org


[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )