Announcement Announcement Module
No announcement yet.
Strange problem with osgi service registration - takes too much time for deployment Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange problem with osgi service registration - takes too much time for deployment

    I am facing a strange problem here.

    I have a bundle in my stress labs which takes too much time to deploy(around 10 minutes).

    I tried to debug the issue my commenting one bean after the other , and i figured out that bean instantiation happens fine and very fast. But what is taking time is the osgi:service registration.

    As i increase the number of osgi service tags , teh time taken to deploy increases. with 10 service registration my bundle deployments fails complaining too much time taken.

    I have taken thread dumps during the interval of deployment and i dont see anything wrong in teh thread trace.

    I am seeing this behaviour in only some machines , though i have the same code base and same version of the Dm serever(1.0.2) running.

    Has anyone faced this problem before ?

  • #2
    Usually it's service references that cause delays when they have to wait for services to be published, so this is very odd. Please check that little CPU is being consumed during the delay as high CPU consumption may be a clue.

    You may find it helpful to look in the serviceability/logs/log.log file. You can configure what goes into this file by modifying config/serviceability.xml - the simplest change is to increase the root logging level from WARN to INFO to get more information.

    As you can see, this is along the lines of "teaching a man to fish"...


    • #3
      Thanks Andy.

      I just did some fishing and found out that the service listener side has a Db call which was taking too much time.Hence my bundle was not getting deployed.

      Now my question is Why are these two synchronous events ?

      That is .

      If i deploy a bundle and it has has 2 osgi services to register with same interface and hence same listeners getting called, Why does this happen synchronously ?

      The second service gets registered only after the completion of logic in the service listener for first service, and hence bundle doesn't deploy until listener code is executed.

      Is there a way we can make bundle deployment independent of service listener code execution .



      • #4
        Thanks .

        I did figure out teh reply from support


        • #5
          The rationale for waiting is so that application deployment does not complete until the application is ready for use, i.e. its dependencies have been satisified. The intention of service damping is for dependencies to come and go subsequently to deployment and for the application not to need redeploying.

          To make an application deploy before certain service dependencies are available, use service reference cardinality. See section of the Spring DM reference.

          Glyn (not Andy - to protect the innocent ;-) )