cloudfoundry / cloudfoundry/cf-java-client

AbstractUaaTokenProvider violates Publisher Spec. Rule 1.3

Open
#1,227 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
334
Forks
319
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have observed below error related to Publisher Spec. Rule 1.3, while trying to get token in AbstractUaaTokenProvider.token(…) method -

reactor.core.Exceptions$ErrorCallbackNotImplemented: reactor.core.publisher.Sinks$EmissionException: Spec. Rule 1.3 - onSubscribe, onNext, onError and onComplete signaled to a Subscriber MUST be signaled serially.

Stack trace -
reactor.core.Exceptions$ErrorCallbackNotImplemented: reactor.core.publisher.Sinks$EmissionException: Spec. Rule 1.3 - onSubscribe, onNext, onError and onComplete signaled to a Subscriber MUST be signaled serially.
Caused by: reactor.core.publisher.Sinks$EmissionException: Spec. Rule 1.3 - onSubscribe, onNext, onError and onComplete signaled to a Subscriber MUST be signaled serially.
at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:56)
Suppressed: The stacktrace has been enhanced by Reactor, refer to additional information below:
Assembly trace from producer [reactor.core.publisher.MonoCacheTime] :
reactor.core.publisher.Mono.checkpoint(Mono.java:2206)
org.cloudfoundry.reactor.tokenprovider.AbstractUaaTokenProvider.token(AbstractUaaTokenProvider.java:261)
Error has been observed at the following site(s):
*__checkpoint() ⇢ at org.cloudfoundry.reactor.tokenprovider.AbstractUaaTokenProvider.token(AbstractUaaTokenProvider.java:261)

While checking the flow with this stacktrace, it seems this error is getting thrown at InternalManySink.emitNext(...) level. It is failing due to state 'FAIL_NON_SERIALIZED', as tryEmitNext(..) is getting triggered by different threads at the same time.

It will be helpful if someone can share some insights on the same, and share any document for more idea on tokenprovider feature of cf java client or share any already existing issue on the same line for more details

Thanks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in AbstractUaaTokenProvider.token(...) at AbstractUaaTokenProvider.java:261 and review the surrounding token-provider flow and Reactor sink usage. Reproduce concurrent tryEmitNext calls that lead to FAIL_NON_SERIALIZED, then verify that token subscribers receive signals serially and that the reported error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.