From: Colin M. <col...@ya...> - 2024-06-27 18:45:43
|
Hello all, here is a follow-up on this issue. I consulted Upstash.com support, I will attach a transcript of our messages. On 20th June they added a reply which I did not see until now because it did not get emailed to me. Part of this says: Normally server doesn't buffer response unless a pipeline is detected. A pipeline is when a client sends multiple consequent requests without waiting response of earlier requests. This makes me suspect that the Redis server wrongly gets into its pipeline mode (https://redis.io/docs/latest/develop/use/pipelining/) and so buffers its replies. However I'm not going to spend more time investigating this myself because I'm now using redis-cloud.com which does not require TLS and works fine with Retcl. Colin. On 05/06/2024 14:22, Pietro Cerutti wrote: > Hi, > > I and Colin have been investigating an issue when using the TLS > extension (https://core.tcl-lang.org/tcltls) to interact with a Redis > server using retcl (https://code.ptrcrt.ch/retcl/). > > I have a small reproducer here, which I have trimmed down to a > minimum. It doesn't include any retcl code, just TLS sockets: > https://gist.github.com/gahr/a9258f0f9cdd20ec0479a409e0db49fd > > The protocol is line-oriented, with \r\n as terminators. > > The setup is as follows: > > 1. we connect to a Redis instance using [tls::socket] > 2. we [chan configure $sock -blocking 0 -translation binary] > 3. we send a command string, and we [chan flush $sock] > 4. we get a read event on the $sock > 5. we [read $sock] in the event handler and expect to get a response > > Point 5. works fine against a local Redis instance w/o TLS. > > When we turn TLS on, we see weird things: > > 1. we get a number of read events where [read $sock] returns "" > 2. sometimes we get meaningful read events afterwards, where a [read > $sock] returns the expected response > 3. sometimes we don't get any meaningful read events after the empty ones > > Under the gist, I have included two comments with sample runs against > my local Redis server and against an intance on upstash.com. You can > see the randomness of the empty / meaningful responses. > > I can provide the output when tcltls is compiled with > -DTCLEXT_TCLTLS_DEBUG, if anyone wants to take a look. > > Any pointers would be appreciated. > |