<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <br>
    <div class="moz-cite-prefix">On 08/17/2015 09:53 AM, Milan Kubík
      wrote:<br>
    </div>
    <blockquote cite="mid:55D192EE.8060409@redhat.com" type="cite">On
      08/11/2015 03:23 PM, Milan Kubík wrote:
      <br>
      <blockquote type="cite">On 08/11/2015 09:53 AM, Jan Cholasta
        wrote:
        <br>
        <blockquote type="cite">On 11.8.2015 09:46, Milan Kubík wrote:
          <br>
          <blockquote type="cite">On 08/11/2015 09:08 AM, Jan Cholasta
            wrote:
            <br>
            <blockquote type="cite">On 11.8.2015 09:00, Milan Kubík
              wrote:
              <br>
              <br>
              <blockquote type="cite">On 08/10/2015 06:22 PM, Milan
                Kubík wrote:
                <br>
                <br>
                <blockquote type="cite">On 08/10/2015 06:02 PM, Milan
                  Kubík wrote:
                  <br>
                  <br>
                  <blockquote type="cite">On 08/10/2015 05:54 PM, Jan
                    Cholasta wrote:
                    <br>
                    <br>
                    <blockquote type="cite">On 10.8.2015 17:43, Milan
                      Kubík wrote:
                      <br>
                      <br>
                      <blockquote type="cite">Hi all,
                        <br>
                        <br>
                        <br>
                        <br>
                        this patch fixes problem described in the ticket
                        [1]
                        <br>
                        <br>
                        that caused the test run to fail completely at
                        every other or so
                        <br>
                        run.
                        <br>
                        <br>
                        I took the liberty to fix most of the pep8
                        issues while I was at it.
                        <br>
                        <br>
                        <br>
                        <br>
                        Thanks to Jan Cholasta for help with identifying
                        this one.
                        <br>
                        <br>
                      </blockquote>
                      <br>
                      <br>
                      IMO this would be more robust:
                      <br>
                      <br>
                      <br>
                      <br>
                          t = None
                      <br>
                      <br>
                          try:
                      <br>
                      <br>
                              ...
                      <br>
                      <br>
                          finally:
                      <br>
                      <br>
                              del t
                      <br>
                      <br>
                              nss.nss_shutdown()
                      <br>
                      <br>
                      <br>
                      <br>
                      By assigning a value to the variable at the
                      beginning you make sure
                      <br>
                      <br>
                      that the del statement will not fail.
                      <br>
                      <br>
                      <br>
                      <br>
                      Honza
                      <br>
                      <br>
                      <br>
                      <br>
                    </blockquote>
                    Thanks for the idea. It also removed the version
                    check.
                    <br>
                    <br>
                    Updated patch attached.
                    <br>
                    <br>
                    <br>
                    <br>
                    Milan
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                  </blockquote>
                  Self NACK.
                  <br>
                  <br>
                  <br>
                  <br>
                  I have updated the fix for all of the leaks in that
                  class. It seems to
                  <br>
                  <br>
                  corrupt the database even when no init/shutdown was
                  called. Just not
                  <br>
                  <br>
                  so often.
                  <br>
                  <br>
                  <br>
                  <br>
                  Milan
                  <br>
                  <br>
                  <br>
                  <br>
                  <br>
                  <br>
                </blockquote>
                NACK again. The problem is the reference counting. Even
                with this patch,
                <br>
                <br>
                there seems to be at least one reference left after 't'
                is deleted and
                <br>
                <br>
                nss.nss_shutdown races with the garbage collector.
                <br>
                <br>
              </blockquote>
              <br>
              <br>
              Doesn't the PKCDDocument object also reference some NSS
              objects? It
              <br>
              might be worth trying to delete it manually before
              nss_shutdown as well.
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
            </blockquote>
            Yes, this patch doesn't work. There are still some
            references left.
            <br>
            <br>
            The problem may be on multiple places in here [1].
            <br>
            <br>
            There may be a reference still bound to the doc label.
            <br>
            Another problem is that python 2 code:
            <br>
            <br>
            [x for x in [123, 456]]
            <br>
            <br>
            creates 2 references to 456 as the list used in the assert
            lives for
            <br>
            some time
            <br>
            before it is garbage collected even though it is not
            reachable,
            <br>
            holding a reference to the object labeled as t.
            <br>
            <br>
            I don't know how nss counts the references to its objects
            but I think we
            <br>
            should ow I think
            <br>
            delete all the objects that use/are used by nss explicitly.
            This means
            <br>
            assigning the list
            <br>
            produced by the list comprehension a name as well and the
            delete it when
            <br>
            it is not needed.
            <br>
            <br>
            I'll send the patch shortly.
            <br>
            <br>
            [1]: <a class="moz-txt-link-freetext" href="https://paste.fedoraproject.org/253748/92783071/">https://paste.fedoraproject.org/253748/92783071/</a>
            <br>
          </blockquote>
          <br>
          Given an assumption that all objects referenced only by local
          variables are deleted when a function returns, maybe this can
          be solved with:
          <br>
          <br>
              def nss_initialized(func):
          <br>
                  def decorated(*args, **kwargs):
          <br>
                      nss.nss_init_nodb()
          <br>
                      try:
          <br>
                          func(*args, **kwargs)
          <br>
                      finally:
          <br>
                          nss.nss_shutdown()
          <br>
                  return decorated
          <br>
          <br>
              ...
          <br>
          <br>
              class test_class(...):
          <br>
                  @nss_initialized
          <br>
                  def test_method(self):
          <br>
                      ...
          <br>
          <br>
          (OTOH and untested)
          <br>
          <br>
        </blockquote>
        It seems that NSS decided the assumption doesn't hold. [1]
        <br>
        Plus, the decorator seems to change the execution order of the
        test cases.
        <br>
        <br>
        [1]: <a class="moz-txt-link-freetext" href="https://paste.fedoraproject.org/253846/39299083/">https://paste.fedoraproject.org/253846/39299083/</a>
        <br>
        <br>
        Milan
        <br>
        <br>
      </blockquote>
      Hi list,
      <br>
      <br>
      since I wasn't successful at solving this problem, I revert to the
      original plan
      <br>
      and propose to take the otp import test out of the execution. The
      attached patch
      <br>
      does this.
      <br>
      <br>
      By no means is this a solution to the problem. Therefore, I think
      the ticket should remain open.
      <br>
      The priority of blocker can be dropped, though. I think 'critical'
      should be used.
      <br>
      <br>
      Cheers,
      <br>
      Milan
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    ACK<br>
    <br>
    Pushed to:<br>
    master: d8b9125895758cbc33821c176f3e5a05654dbee4<br>
    ipa-4-2: 57b07070f0b16f7e0099282d6a78f22c6af00793<br>
    <br>
  </body>
</html>