-
Notifications
You must be signed in to change notification settings - Fork 362
fix subscriptions by not removing the ak subscription when one of the… #510
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
Conversation
… subscriptions is stopped.
Codecov Report
@@ Coverage Diff @@
## master #510 +/- ##
============================================
- Coverage 97.9% 97.23% -0.68%
Complexity 335 335
============================================
Files 106 106
Lines 1290 1300 +10
Branches 207 210 +3
============================================
+ Hits 1263 1264 +1
- Misses 7 14 +7
- Partials 20 22 +2
Continue to review full report at Codecov.
|
8a3e683
to
9f56932
Compare
… the same, by including operation name in the id. Keep hasmaps clean by removing canceled subscriptions
9f56932
to
7e0087a
Compare
@gklijs I tried checking out your performance benchmarks but the step up was taking a little bit longer than expected since I have not used clojure before Is it possible that you can update the override fun handle(session: WebSocketSession): Mono<Void> {
val response = session.receive()
.map { it.payloadAsText }
.flatMap { subscriptionHandler.handle(it, session) }
.map { objectMapper.writeValueAsString(it) }
.map { session.textMessage(it) }
.doFinally { session.close() }
return session.send(response)
} While the handler should close the session when receiving a |
On a side note, I tried using sending the data over as bytes instead of converting to a string to see if that improved performance, but I my quick change did not seem to work so I will need to look into that more val response = session.receive()
.map { it.payloadAsText }
.flatMap { subscriptionHandler.handle(it, session) }
.map { objectMapper.writeValueAsBytes(it) }
.map { session.binaryMessage { dataBufferFactory -> dataBufferFactory.wrap(it) } }
.doFinally { session.close() } |
I'll give it a try tomorrow. You indeed need leiningen (build tool for Clojure) and sassc installed. Now that I better know the problem I might try create a test in the project itself trough. |
The mentioned fix #510 (comment) didn't help. It's still stops after around 120 subscriptions being started and stopped. |
Finally kind of done updating the results (not all variants ran 10 times, would improve accuracy a bit, but not much) https://graphql.gklijs.tech/results/graphql-servers/transactions-per-second |
ExpediaGroup#510) * fix subscriptions by not removing the ak subscription when one of the subscriptions is stopped. * Prevent cancelling subscription for someone else of operation name is the same, by including operation name in the id. Keep hasmaps clean by removing canceled subscriptions
📝 Description
Prevents stopping ka when ending a subscription
🔗 Related Issues
#499 I hoped, but is not helped by it.