I’m stuck on Stage Blocking retrieval #ec3.
Hey all, Having an issue on submission here where the redis-cli in the runner isn’t reporting any output.
Locally my redis-cli works with the same commands, it’s semi inconsistant (sometimes it fails on an earlier stage). Submitted over several days to try and clear any build cache on CodeCrafters side.
Any ideas would be appreciated
Here are my logs:
remote: [tester::#EC3] Running tests for Stage #EC3 (Lists - Blocking retrieval) remote: [tester::#EC3] $ ./your_program.sh remote: [tester::#EC3] [client-1] Connected (port 49124 -> port 6379)
remote: [tester::#EC3] [client-2] Connected (port 49136 -> port 6379)
remote: [tester::#EC3] [client-3] Connected (port 49150 -> port 6379)
remote: [tester::#EC3] [client-2] $ redis-cli BLPOP blueberry 0 remote: [tester::#EC3] [client-2] Sent bytes: "*3\r\n$5\r\nBLPOP\r\n$9\r\nblueberry\r\n$1\r\n0\r\n"
remote: [tester::#EC3] [client-3] $ redis-cli BLPOP blueberry 0
remote: [tester::#EC3] [client-3] Sent bytes: "*3\r\n$5\r\nBLPOP\r\n$9\r\nblueberry\r\n$1\r\n0\r\n"
remote: [tester::#EC3] [client-1] $ redis-cli RPUSH blueberry mango
remote: [tester::#EC3] [client-1] Sent bytes: "*3\r\n$5\r\nRPUSH\r\n$9\r\nblueberry\r\n$5\r\nmango\r\n"
remote: [your_program] Sending output to client: :1
remote: [your_program]
remote: [your_program] stream status: canwrite True
remote: [your_program] Sending output to client: *2
remote: [your_program] $9
remote: [your_program] blueberry
remote: [your_program] $5
remote: [your_program] mango
remote: [your_program]
remote: [your_program] stream status: canwrite True
remote: [tester::#EC3] [client-1] Received bytes: ":1\r\n"
remote: [tester::#EC3] [client-1] Received RESP integer: 1
remote: [tester::#EC3] [client-1] ✔︎ Received 1
remote: [tester::#EC3] [client-2] Expecting response of BLPOP command
remote: [tester::#EC3] Received: "" (no content received)
remote: [tester::#EC3] ^ error remote: [tester::#EC3] Error: Expected start of a new RESP2 value (either +, -, :, $ or *)
remote: [tester::#EC3] Test failed remote: [tester::#EC3] Terminating program remote: [tester::#EC3] Program terminated successfully remote:
Same code failing eleswhere (but less log statements sorry)
remote: [tester::#EC3] [client-1] Connected (port 36236 -> port 6379) remote: [tester::#EC3] [client-2] Connected (port 36238 -> port 6379) remote: [tester::#EC3] [client-3] Connected (port 36240 -> port 6379) remote: [tester::#EC3] [client-2] $ redis-cli BLPOP strawberry 0 remote: [tester::#EC3] [client-2] Sent bytes: "*3\r\n$5\r\nBLPOP\r\n$10\r\nstrawberry\r\n$1\r\n0\r\n" remote: [tester::#EC3] [client-3] $ redis-cli BLPOP strawberry 0
remote: [tester::#EC3] [client-3] Sent bytes: "*3\r\n$5\r\nBLPOP\r\n$10\r\nstrawberry\r\n$1\r\n0\r\n" remote: [tester::#EC3] [client-1] $ redis-cli RPUSH strawberry grape remote: [tester::#EC3] [client-1] Sent bytes: "*3\r\n$5\r\nRPUSH\r\n$10\r\nstrawberry\r\n$5\r\ngrape\r\n" remote: [tester::#EC3] [client-1] Received bytes: ":1\r\n"
remote: [tester::#EC3] [client-1] Received RESP integer: 1
remote: [tester::#EC3] [client-1] ✔︎ Received 1
remote: [tester::#EC3] [client-2] Expecting response of BLPOP command remote: [tester::#EC3] [client-2] Received bytes: "*2\r\n$10\r\nstrawberry\r\n$5\r\ngrape\r\n" remote: [tester::#EC3] [client-2] Received RESP array: ["strawberry", "grape"] remote: [tester::#EC3] [client-2] ✔︎ Received ["strawberry", "grape"] remote: [tester::#EC3] [client-3] Expecting no response
remote: [tester::#EC3] [client-3] ✔︎ No response received yet
remote: [tester::#EC3] Test passed.
remote: [tester::#EC3] Terminating program
remote: [tester::#EC3] Program terminated successfully
remote:
remote: [tester::#JP1] Running tests for Stage #JP1 (Lists - Remove multiple elements) remote: [tester::#JP1] $ ./your_program.sh
remote: [tester::#JP1] [client] $ redis-cli RPUSH banana strawberry pineapple blueberry mango grape banana pear remote: [tester::#JP1] [client] Sent bytes: "*9\r\n$5\r\nRPUSH\r\n$6\r\nbanana\r\n$10\r\nstrawberry\r\n$9\r\npineapple\r\n$9\r\nblueberry\r\n$5\r\nmango\r\n$5\r\ngrape\r\n$6\r\nbanana\r\n$4\r\npear\r\n" remote: [tester::#JP1] [client] Received bytes: ":7\r\n"
remote: [tester::#JP1] [client] Received RESP integer: 7
remote: [tester::#JP1] [client] ✔︎ Received 7
remote: [tester::#JP1] [client] > LPOP banana 2
remote: [tester::#JP1] [client] Sent bytes: "*3\r\n$4\r\nLPOP\r\n$6\r\nbanana\r\n$1\r\n2\r\n" remote: [tester::#JP1] Received: "" (no content received) remote: [tester::#JP1] ^ error remote: [tester::#JP1] Error: Expected start of a new RESP2 value (either +, -, :, $ or *) remote: [tester::#JP1] Test failed remote: [tester::#JP1] Terminating program remote: [tester::#JP1] Program terminated successfully
And here’s a snippet of my code:
Console.WriteLine($"Sending output to client: {output_string} \n stream status: canwrite {stream.CanWrite}");
stream.Write(Encoding.UTF8.GetBytes(output_string.ToString()));
await stream.FlushAsync();
stream.Close();