Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CoroutineCollection.createIndexes #329

Merged
merged 1 commit into from
Mar 30, 2022

Conversation

skkap
Copy link
Contributor

@skkap skkap commented Mar 14, 2022

With the current implementation calling CoroutineCollection.createIndexes throws:

Caused by: java.lang.IllegalArgumentException: More than one onNext value for awaitSingle
	(Coroutine boundary)
	at org.litote.kmongo.coroutine.CoroutineCollection.createIndexes(CoroutineCollection.kt:823)
	at com.skkap.lookback.server.job.EnsureMongodbIndexesJob$ensureIndexes$2.invokeSuspend(EnsureMongodbIndexesJob.kt:18)
Caused by: java.lang.IllegalArgumentException: More than one onNext value for awaitSingle
	at kotlinx.coroutines.reactive.AwaitKt$awaitOne$2$1.onNext(Await.kt:240)
	at reactor.core.publisher.StrictSubscriber.onNext(StrictSubscriber.java:89)
	at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onNext(FluxConcatArray.java:201)
	at reactor.core.publisher.FluxIterable$IterableSubscription.fastPath(FluxIterable.java:340)
	at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:227)
...

I am not confident about the fix, but I believe createIndexes() returns more than one element from a publisher.

Please let me know if you have some suggestions.

@codecov
Copy link

codecov bot commented Mar 14, 2022

Codecov Report

Merging #329 (d9bc2ae) into master (d0133a9) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #329      +/-   ##
============================================
- Coverage     57.17%   57.15%   -0.02%     
  Complexity      742      742              
============================================
  Files           131      131              
  Lines          5445     5445              
  Branches        508      508              
============================================
- Hits           3113     3112       -1     
- Misses         2103     2104       +1     
  Partials        229      229              
Impacted Files Coverage Δ
...org/litote/kmongo/coroutine/CoroutineCollection.kt 49.39% <0.00%> (ø)
...litote/kmongo/coroutine/CoroutineClientSessions.kt 75.00% <0.00%> (-25.00%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d0133a9...d9bc2ae. Read the comment docs.

@zigzago
Copy link
Member

zigzago commented Mar 30, 2022

Thank you for the PR

@zigzago zigzago merged commit f7c5c5c into Litote:master Mar 30, 2022
@skkap skkap deleted the slava-fix-create-indexes branch March 31, 2022 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants