[kiofuse] [Bug 450198] New: SFTP uses cache-based mode instead of FileJob-based

2022-02-14 Thread Tomas Janco
https://bugs.kde.org/show_bug.cgi?id=450198

Bug ID: 450198
   Summary: SFTP uses cache-based mode instead of FileJob-based
   Product: kiofuse
   Version: 5.0.0
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: general
  Assignee: a.saout...@gmail.com
  Reporter: jancoto...@gmail.com
CC: fab...@ritter-vogt.de, kio-bugs-n...@kde.org
  Target Milestone: ---

SUMMARY
Recently (I suspect since v5.0) I started experiencing long delays when opening
a video file via sftp:// url in VLC via kio-fuse. The file starts opening and
does not play for tens of seconds to minutes. The larger the file, the longer
the delay. This does not happen on smb:// urls.

I have found out, via SFTP kio-fuse downloads the whole file before it starts
playing.
I have confirmed this by running 

```
killall kio-fuse; export
QT_LOGGING_RULES="org.kde.kio.fuse.debug=true;kf5.kio.core.*=true;log_kio_sftp=true;log_kio_sftp.trace=true";
/usr/lib64/libexec/kio-fuse -d
```

When using SMB, the output contains:
```
org.kde.kio.fuse: Reading 131072 byte(s) at offset 626688 of (FileJob-based)
node "filename-redacted.mp4"
```

However when using SFTP it contains:
```
org.kde.kio.fuse: Reading 4096 byte(s) at offset 32768 of (cache-based) node
"filename-redacted.mp4"
```

The `--disable-filejob-io` is not set. When I set it, even SMB uses the cache
and downloads the whole file before playing.

The filejob/cache mode selection boils down to this condition
https://github.com/KDE/kio-fuse/blob/master/kiofusevfs.cpp#L1861
But SFTP should support both opening and truncating.


STEPS TO REPRODUCE
1. Open a video file on sftp:// URL

OBSERVED RESULT
Video starts playing after a long delay. The delay is longer for bigger file
sizes. The file is fully downloaded before it starts playing.

EXPECTED RESULT
The video should start playing immediately. (As it does with smb:// urls)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo, 5.15.16-gentoo-x86_64
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
KIO FUSE version 5.0.0
FUSE library version 3.10.5
using FUSE kernel interface version 7.31
fusermount3 version: 3.10.5
kio-extras version: 21.08.3-r1

ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

[kio-extras] [Bug 450198] SFTP uses cache-based mode instead of FileJob-based

2022-02-14 Thread Tomas Janco
https://bugs.kde.org/show_bug.cgi?id=450198

--- Comment #2 from Tomas Janco  ---
But also truncating should not be required for opening a file in read mode via
kio-fuse.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kio-extras] [Bug 450198] SFTP uses cache-based mode instead of FileJob-based

2022-02-15 Thread Tomas Janco
https://bugs.kde.org/show_bug.cgi?id=450198

--- Comment #4 from Tomas Janco  ---
I created merge requests for the required changes:
https://invent.kde.org/frameworks/kio/-/merge_requests/758
https://invent.kde.org/network/kio-extras/-/merge_requests/143

-- 
You are receiving this mail because:
You are watching all bug changes.