[merge] use os._exit

Alexander Belchenko bialix at ukr.net
Mon Feb 19 01:35:22 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool пишет:
> This changes bzr to exit through os._exit when it's done.  This function
> differs from sys.exit in that it does not finalize or gc any objects
> that still exist.  That has two benefits:
> 
> It suppresses the intermittent failure of the smartserver 
> tests that I wrote about yesterday -- python never goes into
> the terrible state of modules disappearing while in use
> 
> By avoiding gc of things that are about to be destroyed we save some
> time at shutdown -- about 50ms in my test, or 14% of the time to do bzr
> status in a bzr tree.

This patch already merged.
But I want to say that it's bad. I'm -1 on this change.
This patch cause to sudden break of tail in .bzr.log.
Therefore long traceback for some error is not recorded properly.

When I test bug #84043 I run recent version of bzr several times. And every time I have incomplete
traceback, like this:

bzr arguments: [u'ci', u'--no-plugins']
encoding stdout as sys.stdout encoding 'cp866'
opening working tree 'C:/work/Documents/\xd0\xa1\xd1\x82\xd0\xb0\xd1\x82\xd1\x8c\xd0\xb8'
got branch format Bazaar-NG Metadir branch format 5
preparing to commit
Selecting files for commit with filter None
[ 4000] Mon 03:10:06.578 INFO: modified .bzrignore
[ 4000] Mon 03:10:06.592 INFO: added SConstruct
[ 4000] Mon 03:10:06.592 INFO: added gettext-on-windows.rstx
check paths: None
Traceback (most recent call last):
  File "C:\work\Bazaar\sandbox\commit.in.non-ascii\bzrlib\commands.py", line 650, in
run_bzr_catch_errors
    return run_bzr(argv)
  File "C:\work\Bazaar\sandbox\commit.in.non-ascii\bzrlib\commands.py", line 612, in run_bzr
    ret = run(*run_argv)
  File "C:\work\Bazaar\sandbox\commit.in.non-ascii\bzrlib\commands.py", line 304, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "C:\work\Bazaar\sandbox\commit.in.non-ascii\bzrlib\builtins.py", line 2064, in run
    reporter=reporter)
  File "C:\work\Bazaar\sandbox\commit.in.non-ascii\bzrlib\decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "C:\work\Bazaar\sandbox\commit.in.non-ascii\bzrlib\mutabletree.py", line 126, in commit
    revprops=revprops, *args, **kwargs)
  File "C:\work\Bazaar\sandbox\commit.in.non-ascii\bzrlib\commit.py", line 313, in commit
    message = message_callback(self)
  File "C:\work\Bazaar\sandbox\commit.in.non-ascii\bzrlib\builtins.py", line 2041, in get_message
    my_message = edit_commit_message(template)
  File "C:\work\Bazaar\sandbox\commit.in.non-ascii\bzrlib\msgeditor.py", line 110, in
edit_commit_message
    if not _run_editor(msgfilename):
  File "C:\work\Bazaar\sandbox\commit.in.non-ascii\bzrlib\msgeditor.py", line 61, in _run_editor
    x = call(edargs + [filename])
  File "C:\Python25\lib\subprocess.py", line 443, in call
    return Popen(*popenar


^-- traceback is incomplete.
When I revert to rev.2292 I get full traceback:

bzr arguments: [u'ci', u'--no-plugins']
encoding stdout as sys.stdout encoding 'cp866'
opening working tree 'C:/work/Documents/\xd0\xa1\xd1\x82\xd0\xb0\xd1\x82\xd1\x8c\xd0\xb8'
got branch format Bazaar-NG Metadir branch format 5
preparing to commit
Selecting files for commit with filter None
[ 4032] Mon 03:27:35.280 INFO: modified .bzrignore
[ 4032] Mon 03:27:35.280 INFO: added SConstruct
[ 4032] Mon 03:27:35.296 INFO: added gettext-on-windows.rstx
check paths: None
Traceback (most recent call last):
  File "C:\work\Bazaar\sandbox\r2292\bzrlib\commands.py", line 650, in run_bzr_catch_errors
    return run_bzr(argv)
  File "C:\work\Bazaar\sandbox\r2292\bzrlib\commands.py", line 612, in run_bzr
    ret = run(*run_argv)
  File "C:\work\Bazaar\sandbox\r2292\bzrlib\commands.py", line 304, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "C:\work\Bazaar\sandbox\r2292\bzrlib\builtins.py", line 2064, in run
    reporter=reporter)
  File "C:\work\Bazaar\sandbox\r2292\bzrlib\decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "C:\work\Bazaar\sandbox\r2292\bzrlib\mutabletree.py", line 126, in commit
    revprops=revprops, *args, **kwargs)
  File "C:\work\Bazaar\sandbox\r2292\bzrlib\commit.py", line 313, in commit
    message = message_callback(self)
  File "C:\work\Bazaar\sandbox\r2292\bzrlib\builtins.py", line 2041, in get_message
    my_message = edit_commit_message(template)
  File "C:\work\Bazaar\sandbox\r2292\bzrlib\msgeditor.py", line 109, in edit_commit_message
    if not _run_editor(msgfilename):
  File "C:\work\Bazaar\sandbox\r2292\bzrlib\msgeditor.py", line 61, in _run_editor
    x = call(edargs + [filename])
  File "C:\Python25\lib\subprocess.py", line 443, in call
    return Popen(*popenargs, **kwargs).wait()
  File "C:\Python25\lib\subprocess.py", line 593, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 793, in _execute_child
    startupinfo)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 22-27: ordinal not in range(128)

return code 3


I think we should roll back.

- --
Alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF2P7azYr338mxwCURAgOLAJ0UlHPVd3m3/UVuSidlgMhuxiWo8wCffmdm
SY5Z08kqkE4qgj0RxNgNyyQ=
=j8xZ
-----END PGP SIGNATURE-----




More information about the bazaar mailing list