osgi-pluginmanager: Jersey REST services not loading reliably in Karaf 4

Description

On Bamboo and on my local machine, the Jersey REST services inside osgi-pluginmanager sometimes (>50%) fail to load, especially on startup into a clean Karaf container where the Jersey JARs have never been installed.

This is caused by a race condition between the jersey-server JAR being "Started" by the Karaf container and then the featuremanager, licencemanager, and pluginmanager REST services being started by the blueprint extender. If the REST services inside the blueprint.xmls attempt to start first, then they throw exceptions and fail to register in our OSGi HTTP bridge service, leading to 404s when trying to access them.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Seth Leger May 15, 2017 at 1:21 PM

PR merged, marking as fixed.

commit 511eb68ccded44152355ea8a0230ff848f36de78

Seth Leger May 11, 2017 at 3:47 PM

Seth Leger May 11, 2017 at 12:16 PM

It looks like the best solution is to reduce the start-level of the Jersey bundles so that Karaf will start them up before the REST service bundles. This seems to fix the problem. I was running the following sequence of commands with a 100% failure rate and after the start-level change, everything is working:

Seth Leger May 11, 2017 at 11:54 AM

This stack trace is an indication of the problem but even if this shows up, I think the services can sometimes register:

Fixed

Details

Assignee

Reporter

Components

Sprint

Fix versions

Affects versions

Priority

PagerDuty

Created May 11, 2017 at 11:46 AM
Updated June 12, 2017 at 12:57 AM
Resolved May 15, 2017 at 1:21 PM