Don't write to clients with CLIENT_CLOSE_ASAP flag#7694
Don't write to clients with CLIENT_CLOSE_ASAP flag#7694jeffreylovitz wants to merge 1 commit intoredis:unstablefrom
Conversation
|
Hey, thanks for trying to fix this, but I'm not sure this is the right fix. We should attempt to write out pending data from a client that has been marked as close asap, since there are certain places we do it intentionally. I'm also wondering what RedisGraph is doing, since the SIGPIPE signal should be ignored. You might want to follow up with them: ref: Line 2815 in e61adc0 |
|
This is indeed odd that you're getting that signal although suppose to be ignored. Regarding the fix, there's actually already a PR with a similar fix and a similar title: #7202 (attempting to fix a different issue), it looks like Salvatore was actually ok with this specific change, but not about another one in that other PR. @madolson i suppose you're referring to |
|
Ohh sorry, i now realize it's not the same change as in the other PR (it's the same as the one Salvatore suggested instead of one of the changes there). |
|
@oranagra no idea, unless it gets overridden elsewhere but it doesn't seem so. |
|
@oranagra We override the SIGUSR signals and, on some versions, inject our own logs upon receiving the SIGSEGV signal before calling the Redis handler. Other than that, RedisGraph shouldn't interfere at all. |
|
@jeffreylovitz I can confirm creating similar situations where there's a lot of buffered output and a client drops, |
|
@yossigo To get more context, I added an explicit |
|
@oranagra I was actually thinking about ACLs, but thinking about it more this PR looks correct, since we have another functionality to achieve the mechanism I was considering. |
|
@jeffreylovitz I think your change should now pass the tests since we fixed the underlying issue, would you mind doing an empty push to your branch to kickoff the CI again? |
**Bug Fixes:** * [#7219](RediSearch/RediSearch#7219) Fix a concurrency issue on Reducer in `FT.AGGREGATE` * [#7255](RediSearch/RediSearch#7255) Fix `BM25STD` underflow wraparound * [#7275](RediSearch/RediSearch#7275) Report used memory as `unsigned long long` to avoid underflows * [#7264](RediSearch/RediSearch#7264) Fix `totalDocsLen` updates * [#6995](RediSearch/RediSearch#6995) Do not fanout `FT.INFO` to replicas * [#7350](RediSearch/RediSearch#7350) Fix `FT.CREATE` failure with LeanVec parameters on non-Intel architectures * [#7694](RediSearch/RediSearch#7694) Use asynchronous jobs for GC in SVS to accelerate execution * [#7384](RediSearch/RediSearch#7384) Fix index load from RDB temporary memory overhead * [#7459](RediSearch/RediSearch#7459) Fix Fork GC potential double-free on error path * [#7458](RediSearch/RediSearch#7458) Fix a GC performence regression * [#7470](RediSearch/RediSearch#7470) Avoid draining worker thread pool from FLUSH callback to avoid deadlocks * [#7554](RediSearch/RediSearch#7554) Handle the case where `SCORE` is sent alone without extra fields (coordinator) * [#7685](RediSearch/RediSearch#7685) Fix cursor logical leak * [#7794](RediSearch/RediSearch#7794) Fix `cmp_strings()` to correctly handle binary data with embedded NULLs in TOLIST reducer in FT.AGGREGATE * [#7873](RediSearch/RediSearch#7873) Handle warnings in empty `FT.AGGREGATE` replies (cluster) * [#7886](RediSearch/RediSearch#7886) Remove non-TEXT fields from the spec keys dictionary * [#7904](RediSearch/RediSearch#7904) Refactor keys dictionary handling * [#7901](RediSearch/RediSearch#7901) Support multiple warnings in reply * [#8083](RediSearch/RediSearch#8083) Fix incorrect FULLTEXT field metric counts * [#8153](RediSearch/RediSearch#8153) Fix configuration registration issues **Improvements:** * [#7154](RediSearch/RediSearch#7154) `FT.AGGREGATE` can return Background Indexing OOM warnings * [#7083](RediSearch/RediSearch#7083) Add the default text scorer as a configuration option * [#7341](RediSearch/RediSearch#7341) Rename `FT.PROFILE` counter fields * [#7436](RediSearch/RediSearch#7436) Enhance `FT.PROFILE` with vector search execution details * [#7435](RediSearch/RediSearch#7435) Ensure full `FT.PROFILE` output on timeout with RETURN policy * [#7534](RediSearch/RediSearch#7534) Reduce the number of worker threads asynchronously to avoid deadlocks during queries * [#7614](RediSearch/RediSearch#7614) Track timeout warnings and errors in INFO * [#7646](RediSearch/RediSearch#7646) Track `maxprefixexpansions` warnings and errors in INFO * [#7577](RediSearch/RediSearch#7577) Track query syntax/argument errors (basis for query error tracking) * [#7737](RediSearch/RediSearch#7737) Add `Internal cursor reads` metric to cluster `FT.PROFILE` output * [#7759](RediSearch/RediSearch#7759) Extend indexing metrics * [#7710](RediSearch/RediSearch#7710) Support `WITHCOUNT` keyword in `FT.AGGREGATE` * [#7957](RediSearch/RediSearch#7957) Persist query warnings across cursor reads * [#8054](RediSearch/RediSearch#8054) Add logging for index-related commands * [#8151](RediSearch/RediSearch#8151) Fix shard total profile time reporting in `FT.PROFILE` * [#8103](RediSearch/RediSearch#8103) Output current thread IndexSpec information on crash
This PR resolves an issue observed on RedisGraph in which prematurely closing clients that are awaiting replies from Redis can cause a server crash on a broken pipe.
I can consistently reproduce this issue locally, but the code to do so is unfortunately non-trivial. The reproduction steps include instantiating several clients, issuing RedisGraph commands which return data, then disconnecting the clients without waiting for responses.
This causes a crash with the stack trace:
This issue is reproduce on unstable and 6.0.6, this PR resolves it on both.