Bug 466900

Summary: Okular startup delay due to historically automounted filesystems that are currently inaccessble
Product: [Applications] okular Reporter: Wiley Sanders <wsanders>
Component: generalAssignee: Okular developers <okular-devel>
Status: REPORTED ---    
Severity: minor    
Priority: NOR    
Version: 21.12.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Wiley Sanders 2023-03-05 17:18:18 UTC
Looks like okular suffers a 30 sec or so startup delay when it looks for historically automounted filesystems that are currently inaccessble. In other words, I see this on startup in strace:

[code]
[pid 48984] openat(AT_FDCWD, "/home/wsanders/.local/share/okular/bookmarks.xml", O_RDONLY|O_CLOEXEC) = 10
[pid 48984] statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0600, stx_size=2410, ...}) = 0
[pid 48984] statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0600, stx_size=2410, ...}) = 0
[pid 48984] read(10, "<?xml version=\"1.0\" encoding=\"UT"..., 16384) = 2410
[pid 48984] read(10, "", 13974)         = 0
[pid 48984] read(10, "", 16384)         = 0
[pid 48984] read(10, "", 16384)         = 0
[pid 48984] close(10)                   = 0
[pid 48984] readlink("/net", 0x7ffc73fb8090, 1023) = -1 EINVAL (Invalid argument)
[pid 48984] readlink("/net/192.169.1.1",  <unfinished ...>                                                   <<<---- HERE
[pid 48987] <... poll resumed>)         = 1 ([{fd=3, revents=POLLIN}])
[pid 48987] recvmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="U\2\250\1\377dX\5\3\4\4\0\0\0\0\0\0\0\0\4\4\4\4\4\0\0\3\37%\2\0\0", iov_len=4096}], 
[code]

"/net/192.169.1.1..." is a previously automounted filesystem, but my server 192.169.1.1 is down.

I have no bookmarks, but the bookmarks.xml  file does have references to files in /net/192.169.1.1; it appears that  that is where the recently open files list is stored. 


STEPS TO REPRODUCE
1. Mount a automounted (manually mounted will probably do this too) NFS filesystem and open some files in it.
2. Exit okular
3. Shutdown the NFS server, disable automounter, or (not tested) unmount the filesystem, then restart okular.



OBSERVED RESULT
You should encounter a approx 30 sec delay on startup. 

EXPECTED RESULT
Okular should ascertain that some on the files in bookmarks.xml are not accessible and ignore them so it will open without delay.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Wiley Sanders 2023-03-05 17:20:20 UTC
What happened to my description? Here it is in case it got lost:

Looks like okular suffers a 30 sec or so startup delay when it looks for historically automounted filesystems that are currently inaccessble. In other words, I see this on startup in strace:

[code]
[pid 48984] openat(AT_FDCWD, "/home/wsanders/.local/share/okular/bookmarks.xml", O_RDONLY|O_CLOEXEC) = 10
[pid 48984] statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0600, stx_size=2410, ...}) = 0
[pid 48984] statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0600, stx_size=2410, ...}) = 0
[pid 48984] read(10, "<?xml version=\"1.0\" encoding=\"UT"..., 16384) = 2410
[pid 48984] read(10, "", 13974)         = 0
[pid 48984] read(10, "", 16384)         = 0
[pid 48984] read(10, "", 16384)         = 0
[pid 48984] close(10)                   = 0
[pid 48984] readlink("/net", 0x7ffc73fb8090, 1023) = -1 EINVAL (Invalid argument)
[pid 48984] readlink("/net/192.169.1.1",  <unfinished ...>                                                   <<<---- HERE
[pid 48987] <... poll resumed>)         = 1 ([{fd=3, revents=POLLIN}])
[pid 48987] recvmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="U\2\250\1\377dX\5\3\4\4\0\0\0\0\0\0\0\0\4\4\4\4\4\0\0\3\37%\2\0\0", iov_len=4096}], 
[code]

"/net/192.169.1.1..." is a previously automounted filesystem, but my server 192.169.1.1 is down.

I have no bookmarks, but the bookmarks.xml  file does have references to files in /net/192.169.1.1; it appears that  that is where the recently open files list is stored. 


STEPS TO REPRODUCE
1. Mount a automounted (manually mounted will probably do this too) NFS filesystem and open some files in it.
2. Exit okular
3. Shutdown the NFS server, disable automounter, or (not tested) unmount the filesystem, then restart okular.


OBSERVED RESULT
You should encounter a approx 30 sec delay on startup. 

EXPECTED RESULT
Okular should ascertain that some on the files in bookmarks.xml are not accessible and ignore them so it will open without delay.