On 11-06-23 12:36 PM, Gavin Panella wrote:
> [1]
>
> + @staticmethod
> + def _register_subclass(cls):
> + """Register this class with its enumeration."""
> + # This would be a classmethod, except that subclasses (e.g.
> + # TranslationPackagingJob) need to be able to override it and call
> + # into it, and there's no syntax to call a base class's version of a
> + # classmethod with the subclass as the first parameter.
>
> I think super(BranchJobDerived, cls)._register_subclass() might work.
This doesn't work because _register_subclass is called before
BranchJobDerived is part of the global namespace (because it's called by
the metaclass).
$ python superme.py
Traceback (most recent call last):
File "superme.py", line 7, in <module>
class Foo(object):
File "superme.py", line 4, in __init__
cls.upcall()
File "superme.py", line 13, in upcall
super(Foo, cls)
NameError: global name 'Foo' is not defined
> [2]
>
> +class BranchMailJobSource(BaseRunnableJobSource):
> + """Source of jobs that send mail about branches."""
> +
> + memory_limit = 2 * (1024 ** 3)
>
> 2GB is quite a high limit. Is that correct?
I'm using the limit applied to cronscripts/scan_branches.py (in 12991)
as an example. sendbranchmail runs on the same machine and uses similar
technology, including bzrlib.
The bug reports that 5GB is problematic, so this cuts it by more than half.
If you're wondering whether bzrlib really needs that much, well, it has
been quite memory-hungry historically, but I understand bzr 2.4 will be
a vast improvement.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11-06-23 12:36 PM, Gavin Panella wrote: subclass( cls): agingJob) need to be able to override it and call Derived, cls)._register_ subclass( ) might work.
> [1]
>
> + @staticmethod
> + def _register_
> + """Register this class with its enumeration."""
> + # This would be a classmethod, except that subclasses (e.g.
> + # TranslationPack
> + # into it, and there's no syntax to call a base class's version of a
> + # classmethod with the subclass as the first parameter.
>
> I think super(BranchJob
This doesn't work because _register_subclass is called before
BranchJobDerived is part of the global namespace (because it's called by
the metaclass).
class Bar(type):
def __init__(cls, name, bases, dict_):
cls.upcall( )
class Foo(object):
__metaclass__ = Bar
@classmethod
def upcall(cls):
super(Foo, cls)
$ python superme.py
Traceback (most recent call last):
File "superme.py", line 7, in <module>
class Foo(object):
File "superme.py", line 4, in __init__
cls.upcall()
File "superme.py", line 13, in upcall
super(Foo, cls)
NameError: global name 'Foo' is not defined
> [2] urce(BaseRunnab leJobSource) :
>
> +class BranchMailJobSo
> + """Source of jobs that send mail about branches."""
> +
> + memory_limit = 2 * (1024 ** 3)
>
> 2GB is quite a high limit. Is that correct?
I'm using the limit applied to cronscripts/ scan_branches. py (in 12991)
as an example. sendbranchmail runs on the same machine and uses similar
technology, including bzrlib.
The bug reports that 5GB is problematic, so this cuts it by more than half.
If you're wondering whether bzrlib really needs that much, well, it has
been quite memory-hungry historically, but I understand bzr 2.4 will be
a vast improvement.
Aaron enigmail. mozdev. org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAk4 DeNAACgkQ0F+ nu1YWqI2WkQCfZr i8hj8jxxSp76TSr DZ1cvAL dsU6qFgVa72NuZv tr/YxM9PU
7vEAniM+
=Mzw0
-----END PGP SIGNATURE-----