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

          Christoph Gritschenberger created issue -
          Christoph Gritschenberger made changes -
          Field Original Value New Value
          Description I did a little investigation and I think I found out why:

          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).

          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?
          Andreas Pieber made changes -
          Assignee Christoph Gritschenberger [ christophg ]
          Fix Version/s framework-2.4.3 [ 10660 ]
          Fix Version/s framework-2.5.0 [ 10596 ]
          Fix Version/s framework-3.0.0 [ 10488 ]
          Andreas Pieber made changes -
          Fix Version/s framework-2.4.4 [ 10761 ]
          Fix Version/s framework-2.4.3 [ 10660 ]
          Andreas Pieber made changes -
          Fix Version/s framework-2.4.5 [ 10764 ]
          Fix Version/s framework-2.4.4 [ 10761 ]
          Andreas Pieber made changes -
          Fix Version/s framework-2.5.1 [ 10771 ]
          Fix Version/s framework-2.6.0 [ 10763 ]
          Fix Version/s framework-2.4.5 [ 10764 ]
          Fix Version/s framework-2.5.0 [ 10596 ]
          Christoph Gritschenberger made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          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.
          Christoph Gritschenberger made changes -
          Fix Version/s framework-2.4.5 [ 10764 ]
          Fix Version/s framework-2.5.0 [ 10596 ]
          Fix Version/s framework-2.6.0 [ 10763 ]
          Fix Version/s framework-2.5.1 [ 10771 ]
          Christoph Gritschenberger made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Andreas Pieber made changes -
          Workflow jira [ 12514 ] OpenEngSB Workflow [ 16932 ]
          Andreas Pieber made changes -
          Labels archived
          Stefan Scheiber made changes -
          Workflow OpenEngSB Workflow [ 16932 ] OpenEngSB 2 Workflow [ 21702 ]
          Stefan Scheiber made changes -
          Fix Version/s openengsb-3.0.0 [ 10169 ]
          Fix Version/s framework-3.0.0 [ 10488 ]
          Fix Version/s framework-2.5.0 [ 10596 ]
          Fix Version/s framework-2.4.5 [ 10764 ]
          Stefan Scheiber made changes -
          Fix Version/s openengsb-3.0.0.M1 [ 11164 ]
          Fix Version/s openengsb-3.0.0 [ 10169 ]
          Assignee Time in statuses
          Christoph Gritschenberger
          The issue is open and ready for the assignee to start work on it.Open
          21/Mar/12 10:33 - 24/Apr/12 17:13 : 821 h, 39 m
          Total: 821 h, 39 m
          A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.Resolved
          24/Apr/12 17:13 - 25/Apr/12 15:37 : 22 h, 24 m
          Total: 22 h, 24 m
          The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.Closed
          25/Apr/12 15:37 - Today 10:12 : 48931 h, 34 m
          Total: 48931 h, 34 m
          unknown
          The issue is open and ready for the assignee to start work on it.Open
          18/Jun/11 19:53 - 21/Mar/12 10:33 : 6639 h, 39 m
          Total: 6639 h, 39 m
          Status Time from assignees
          The issue is open and ready for the assignee to start work on it.Open
          Christoph Gritschenberger
          21/Mar/12 10:33 - 24/Apr/12 17:13 : 821 h, 39 m
          Total: 821 h, 39 m
          unknown
          18/Jun/11 19:53 - 21/Mar/12 10:33 : 6639 h, 39 m
          Total: 6639 h, 39 m
          A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.Resolved
          Christoph Gritschenberger
          24/Apr/12 17:13 - 25/Apr/12 15:37 : 22 h, 24 m
          Total: 22 h, 24 m
          The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.Closed
          Christoph Gritschenberger
          25/Apr/12 15:37 - Today 10:12 : 48931 h, 34 m
          Total: 48931 h, 34 m

            People

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

              Dates

              • Created:
                Updated:
                Resolved: