File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
riffle-server/src/store/local Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -466,6 +466,12 @@ impl LocalIO for UringIo {
466466 path : & str ,
467467 options : ReadOptions ,
468468 ) -> anyhow:: Result < DataBytes , WorkerError > {
469+ // if the io_mode is sendfile, we fallback to sync io read
470+ if matches ! ( options. io_mode, IoMode :: SENDFILE ) {
471+ // use sendfile via sync io
472+ return self . sync_local_io . read ( path, options) . await ;
473+ }
474+
469475 let ( offset, length) = match & options. read_range {
470476 ReadRange :: ALL => {
471477 let fs_sts = self . file_stat ( path) . await ?;
@@ -484,7 +490,7 @@ impl LocalIO for UringIo {
484490 let file = OpenOptions :: new ( ) . read ( true ) . open ( path) ?;
485491 let raw_fd = file. as_raw_fd ( ) ;
486492
487- // make the size as the optional config option in io-uring
493+ // todo: make the size as the optional config option in io-uring
488494 if matches ! ( options. io_mode, IoMode :: SPLICE ) && length < 16 * 1024 * 1024 {
489495 // init the pipe
490496 let ( pipe_in, mut pipe_out) = {
You can’t perform that action at this time.
0 commit comments