Build Your Own Kafka - Concurrent Requests #SK0 - Untested behavior

Using Rust

Concurrent requests succeeds even if threads panic when clients disconnect. Technically successfully responding, but not good practice.

remote: [tester::#WA6] Hexdump of sent "ApiVersions" request:
remote: [tester::#WA6] Idx  | Hex                                             | ASCII
remote: [tester::#WA6] -----+-------------------------------------------------+-----------------
remote: [tester::#WA6] 0000 | 00 00 00 23 00 12 00 04 29 bb 07 85 00 09 6b 61 | ...#....).....ka
remote: [tester::#WA6] 0010 | 66 6b 61 2d 63 6c 69 00 0a 6b 61 66 6b 61 2d 63 | fka-cli..kafka-c
remote: [tester::#WA6] 0020 | 6c 69 04 30 2e 31 00                            | li.0.1.
remote: [tester::#WA6]
remote: [tester::#WA6] Hexdump of received "ApiVersions" response:
remote: [tester::#WA6] Idx  | Hex                                             | ASCII
remote: [tester::#WA6] -----+-------------------------------------------------+-----------------
remote: [tester::#WA6] 0000 | 00 00 00 13 29 bb 07 85 00 00 02 00 12 00 03 00 | ....)...........
remote: [tester::#WA6] 0010 | 04 00 00 00 00 00 00                            | .......
remote: [tester::#WA6]
remote: [tester::#WA6] [Decoder] - .Response
remote: [tester::#WA6] [Decoder]   - .message_length (19)
remote: [tester::#WA6] [Decoder] - .ResponseHeader
remote: [tester::#WA6] [Decoder]   - .correlation_id (700123013)
remote: [tester::#WA6] ✓ Correlation ID: 700123013
remote: [your_program] thread 'tokio-runtime-worker' panicked at src/main.rs:38:45:
remote: [tester::#NV3] Test passed.
remote: [tester::#NV3] Terminating program
remote: [your_program] called `Result::unwrap()` on an `Err` value: Buffer too short to read message size
remote: [your_program] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
remote: [tester::#NV3] Program terminated successfully
remote:
remote: [tester::#VI6] Running tests for Stage #VI6 (Bind to a port)
remote: [tester::#VI6] $ ./your_program.sh /tmp/server.properties
remote: [tester::#VI6] Connecting to port 9092...
remote: [tester::#VI6] Connection successful
remote: [tester::#VI6] Test passed.
remote: [tester::#VI6] Terminating program
remote: [tester::#VI6] Program terminated successfully
remote:
remote: Test passed. Congrats!

If this is a case where the program exists with a non-zero exit code, we should be able to catch it and report a failure.

Andy (@andy1li) will test this soon and report back!

1 Like

This is a non-fatal error

Ah, hmm yeah then it isn’t trivial to catch at the moment. We have ideas for catch things like this but will need a bunch of work to support all languages, minimize false positieves etc. Not something we’re going to work on right away, but someday!

1 Like