osgi / bugzilla-archive

Archive of OSGi Alliance Specification Bugzilla bugs. The Specification Bugzilla system was decommissioned with the move to GitHub. The issues in this repository are imported from the Specification Bugzilla system for archival purposes.
0 stars 1 forks source link

[RFC-217] In section 151.4.1.1 it is not clear how to handle ServiceReference order #2966

Closed bjhargrave closed 4 years ago

bjhargrave commented 5 years ago

Original bug ID: BZ#3098 From: Carlos Sierra <carlos.sierra@liferay.com> Reported version: R7

bjhargrave commented 5 years ago

Comment author: Carlos Sierra <carlos.sierra@liferay.com>

in the section it is read:

When clashes occur in the JAX-RS whiteboard then resources supplied using the service whiteboard must be preferred to static resources contained in the application. Otherwise resource method selection follows the normal rules defined in the JAX-RS specification.

This last "Otherwise resource method selection follows the normal rules defined in the JAX-RS specification" is misleading, since it will only happen to static, non service, resources since service references have a defined order and never tie.

Since JAX-RS has a specified clashing resolution mechanism it can be expected that it is used to solve conflicts between services that do not specify any ranking, or services that specify the same ranking.

bjhargrave commented 5 years ago

Comment author: @timothyjward

As per discussion in the 28th November EEG call, we agree that the spec text needs to be tightened up, and that it should talk specifically about Service Ranking. The proposal is to change the quoted paragraph of 151.4.1.1 to:

When clashes occur in the JAX-RS whiteboard then resources supplied using the service whiteboard must be preferred to static resources contained in the application. If two or more whiteboard resources exist then they must be ordered using their service ranking. Unlike for other services in the JAX-RS whiteboard, whiteboard resource services must not be ordered using their natural ordering. Whiteboard resource services with the same ranking must be considered equal, following the normal resource method selection rules defined in the JAX-RS specification. As per the core specification, whiteboard services with no service.ranking property must be treated as having a ranking of 0.

bjhargrave commented 5 years ago

Comment author: @timothyjward

As there have been no objections to the proposed text I have committed it into the OSGi core branch (bd9189ab87657df4fb8e484404bfdddb366e7982)

bjhargrave commented 5 years ago

Comment author: @bjhargrave

This is marked Errata, so we also need errata text for https://www.osgi.org/osgi-release-7-errata/ that can be sent to Mike Francis. Can you please propose the Errata text?

bjhargrave commented 5 years ago

Comment author: @timothyjward

Proposed erratum text:

151.4.1.1 The discussion of clashing resource mappings is updated to clarify the expected behaviour when multiple whiteboard resources provide resource methods which map to the same URI. The previous text failed to define how the ranking of these services would interact with the existing JAX-RS resource selection algorithm.

bjhargrave commented 5 years ago

Comment author: @bjhargrave

(In reply to Tim Ward from comment BZ#4)

Proposed erratum text:

151.4.1.1 The discussion of clashing resource mappings is updated to clarify the expected behaviour when multiple whiteboard resources provide resource methods which map to the same URI. The previous text failed to define how the ranking of these services would interact with the existing JAX-RS resource selection algorithm.

This only says there is a change but not what the change is. One should be able to take the released spec and the errata text and know what the clarified spec says. The proposed errata text does not tell a reader what the clarified behavior is.

bjhargrave commented 5 years ago

Comment author: @timothyjward

Updated proposed erratum text:

151.4.1.1 The discussion of clashing resource mappings is updated to clarify the expected behaviour when multiple whiteboard resources provide resource methods which map to the same URI. The previous text failed to define how the ranking of these services would interact with the existing JAX-RS resource selection algorithm.

The updated text requires that higher ranked services take precedence over lower ranked services, but that equally ranked services fall back to the default JAX-RS resource method selection algorithm. It remains the case that static resources in a whiteboard application behave as if they have a ranking less than that of all whiteboard services.

bjhargrave commented 4 years ago

Comment author: @bjhargrave

CPEG call: BJ to update errata.

bjhargrave commented 4 years ago

Comment author: @bjhargrave

R7 Errata updated