b351c8e467
Returning end-of-input from chunks::read on a disconnected receiver also masked a panicking ext_sort sorter thread (comparator or Rayon panic in sort_by), letting sort exit 0 with truncated or empty output. Retain the sorter JoinHandle and join it after read_write_loop, mapping a thread panic to an error; drop the sorted-chunk receiver first so a still-running sorter unblocks instead of deadlocking the join. Added an external multi-chunk sort test covering the spill-to-files join path. Fixes #6736