Details

      Description

      I did a little investigation and I think I found out why:
      The problem seems to be in the private method
      DefaultOsgiUtilsService.waitForServiceFromTracker(ServiceTracker, long)

      It does the following to the tracker:
      tracker.open()
      tracker.waitforService()
      tracker.close()

      Now two threads do this concurrently this might fail:
      T1: tracker.open()
      T2: tracker.open()
      T1: tracker.waitforService()
      T1: tracker.cose()
      T2: tracker.waitforService() -> returns null

      The question is, what do we do about it.
      I think this is an actual problem (not just in this test).

      I think making the function synchronized is a bad solution.
      I thought we could just skip closing the tracker (tried it, and did not encounter the bug since).

        Gliffy Diagrams

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          Hide
          Christoph Gritschenberger added a comment -

          Should trackers in service-proxies always stay open?
          should we provide a way to cleanup the proxies?

          Show
          Christoph Gritschenberger added a comment - Should trackers in service-proxies always stay open? should we provide a way to cleanup the proxies?
          Hide
          Andreas Pieber added a comment -

          the interesting question is what happens if a tracker is not closed/cleanedup. I'm somehow afraid that this adds a big overhead if the openengsb runs for some time. So I'm not sure if I really like that they are openned all the time. I think it would be preferable to have an option to cleanup them. Maybe manually or find all unused by a reaper thread? Something similar the file-utils have for files?

          Show
          Andreas Pieber added a comment - the interesting question is what happens if a tracker is not closed/cleanedup. I'm somehow afraid that this adds a big overhead if the openengsb runs for some time. So I'm not sure if I really like that they are openned all the time. I think it would be preferable to have an option to cleanup them. Maybe manually or find all unused by a reaper thread? Something similar the file-utils have for files?
          Hide
          Christoph Gritschenberger added a comment -

          There are cases we actually want them to stay opened, like the global-references in the workflow-engine.
          However I think we have some throw-away proxies in there too.

          Show
          Christoph Gritschenberger added a comment - There are cases we actually want them to stay opened, like the global-references in the workflow-engine. However I think we have some throw-away proxies in there too.
          Hide
          Andreas Pieber added a comment -

          well, this wont work against the approach of registering some trackers for automatic close-down. Maybe we could make this a little bit more intelligent?

          Show
          Andreas Pieber added a comment - well, this wont work against the approach of registering some trackers for automatic close-down. Maybe we could make this a little bit more intelligent?
          Hide
          Christoph Gritschenberger added a comment -

          We clean up the proxies obtained with the existing methods, and add some methods to retrieve permanent proxies.

          Show
          Christoph Gritschenberger added a comment - We clean up the proxies obtained with the existing methods, and add some methods to retrieve permanent proxies.
          Hide
          Andreas Pieber added a comment -

          yeah, this sounds definitely easier +1

          Show
          Andreas Pieber added a comment - yeah, this sounds definitely easier +1
          Hide
          Andreas Pieber added a comment -

          can you scatch an idea in code?

          Show
          Andreas Pieber added a comment - can you scatch an idea in code?
          Hide
          Christoph Gritschenberger added a comment -

          OK, this didn't happen for a while now.
          It seems some implementation has changed that the test now always runs green.

          It does happen when two threads operate on the same proxy, so I created a new (simpler) one.
          I added a little sync, so that it works now.

          Show
          Christoph Gritschenberger added a comment - OK, this didn't happen for a while now. It seems some implementation has changed that the test now always runs green. It does happen when two threads operate on the same proxy, so I created a new (simpler) one. I added a little sync, so that it works now.

            People

            • Assignee:
              Christoph Gritschenberger
              Reporter:
              Christoph Gritschenberger
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: