You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Christian Heimes <li...@cheimes.de> on 2011/05/12 20:31:03 UTC

Excluding inner classes is broken

Hello,

JCC 2.7 broke exclusion of inner classes. It's no longer possible to
exclude an inner class like

   --exclude com.browseengine.bobo.facets.FacetHandler$TermCountSize

We exclude the inner class because it breaks MSVC on Windows with an
obscure error message. Since we don't need the inner class in Python, I
excluded it. JCC 2.7 and 2.8 ignore the pattern, because they check for
"className.split('$', 1)[0] in excludes" and no longer for "className in
excludes". The small patch fixes the problem.

Christian


Index: jcc/cpp.py
===================================================================
--- jcc/cpp.py  (revision 1088091)
+++ jcc/cpp.py  (working copy)
@@ -199,7 +199,7 @@
         cls = cls.getComponentType()

     className = cls.getName()
-    if className.split('$', 1)[0] in excludes:
+    if className.split('$', 1)[0] in excludes or className in excludes:
         return False

     if cls.isPrimitive():
@@ -544,7 +544,7 @@
             packages.add('java.lang')

         for className in classNames:
-            if className.split('$', 1)[0] in excludes:
+            if className.split('$', 1)[0] in excludes or className in
excludes:
                 continue
             cls = findClass(className.replace('.', '/'))
             if Modifier.isPublic(cls.getModifiers()):

Re: Excluding inner classes is broken

Posted by Andi Vajda <va...@apache.org>.
On May 30, 2011, at 2:35, Christian Heimes <li...@cheimes.de> wrote:

> Am 27.05.2011 23:33, schrieb Andi Vajda:
>>> So far the patch is reliable and has improved the stability a lot. I
>>> haven't seen a single segfault under Linux X86_64 today. Our test suite
>>> has run a dozen times or more. The last five Win32 X86 test runs were
>>> stable, too.
>> 
>> I integrated your patch into svn rev 1128467.
> 
> Thank you very much! The patch has proven itself as stable over the last
> weeks . I haven't seen a JCC related segfault on our testing and
> production servers.
> 
> A while ago I started thread about on python-ideas about the cause of
> the issue. I'm working on two PEPs to improve the situation on Python
> 3.3, too. Is there anything you want to add to the discussion?

I've been following the discussion - I've been cc'ed - and have nothing to add. Your proposal should work nicely, at least for the attach part. I haven't had much luck with detachCurrentThread() in the past.

As for Python 3 support, I did a port of jcc to Python 3.2 a while ago and it's been available as an experiment on a branch. I should refresh it to catch up with the latest changes at some point.

I don't know what to do about the two version conundrum, when to cut over from Python 2 to Python 3. Supporting both is almost twice the work...

Andi..

> 
> Christian

Re: Excluding inner classes is broken

Posted by Christian Heimes <li...@cheimes.de>.
Am 27.05.2011 23:33, schrieb Andi Vajda:
>> So far the patch is reliable and has improved the stability a lot. I
>> haven't seen a single segfault under Linux X86_64 today. Our test suite
>> has run a dozen times or more. The last five Win32 X86 test runs were
>> stable, too.
> 
> I integrated your patch into svn rev 1128467.

Thank you very much! The patch has proven itself as stable over the last
weeks . I haven't seen a JCC related segfault on our testing and
production servers.

A while ago I started thread about on python-ideas about the cause of
the issue. I'm working on two PEPs to improve the situation on Python
3.3, too. Is there anything you want to add to the discussion?

Christian

Re: Excluding inner classes is broken

Posted by Andi Vajda <va...@apache.org>.
On Thu, 12 May 2011, Christian Heimes wrote:

> Am 12.05.2011 21:10, schrieb Andi Vajda:
>> Indeed.
>> Thank you for patch.
>
> You are welcome!
>
>> How's yesterday's issue's patch doing ?
>> Is it reliable enough ?
>
> So far the patch is reliable and has improved the stability a lot. I
> haven't seen a single segfault under Linux X86_64 today. Our test suite
> has run a dozen times or more. The last five Win32 X86 test runs were
> stable, too.

I integrated your patch into svn rev 1128467.

Andi..

Re: Excluding inner classes is broken

Posted by Christian Heimes <li...@cheimes.de>.
Am 12.05.2011 21:10, schrieb Andi Vajda:
> Indeed.
> Thank you for patch.

You are welcome!

> How's yesterday's issue's patch doing ?
> Is it reliable enough ?

So far the patch is reliable and has improved the stability a lot. I
haven't seen a single segfault under Linux X86_64 today. Our test suite
has run a dozen times or more. The last five Win32 X86 test runs were
stable, too.

Christian

Re: Excluding inner classes is broken

Posted by Andi Vajda <va...@apache.org>.
On Thu, 12 May 2011, Christian Heimes wrote:

> JCC 2.7 broke exclusion of inner classes. It's no longer possible to
> exclude an inner class like
>
>   --exclude com.browseengine.bobo.facets.FacetHandler$TermCountSize
>
> We exclude the inner class because it breaks MSVC on Windows with an
> obscure error message. Since we don't need the inner class in Python, I
> excluded it. JCC 2.7 and 2.8 ignore the pattern, because they check for
> "className.split('$', 1)[0] in excludes" and no longer for "className in
> excludes". The small patch fixes the problem.

Indeed.
Thank you for patch.

How's yesterday's issue's patch doing ?
Is it reliable enough ?

Andi..

>
> Christian
>
>
> Index: jcc/cpp.py
> ===================================================================
> --- jcc/cpp.py  (revision 1088091)
> +++ jcc/cpp.py  (working copy)
> @@ -199,7 +199,7 @@
>         cls = cls.getComponentType()
>
>     className = cls.getName()
> -    if className.split('$', 1)[0] in excludes:
> +    if className.split('$', 1)[0] in excludes or className in excludes:
>         return False
>
>     if cls.isPrimitive():
> @@ -544,7 +544,7 @@
>             packages.add('java.lang')
>
>         for className in classNames:
> -            if className.split('$', 1)[0] in excludes:
> +            if className.split('$', 1)[0] in excludes or className in
> excludes:
>                 continue
>             cls = findClass(className.replace('.', '/'))
>             if Modifier.isPublic(cls.getModifiers()):
>