BiglySoftware / BiglyBT

Feature-filled Bittorrent client based on the Azureus open source project
https://www.biglybt.com
GNU General Public License v2.0
1.52k stars 153 forks source link

[Feature request] switch to "upload only" mode on a write error & possibly more #3303

Closed 2peer closed 1 week ago

2peer commented 2 weeks ago

Suggested in this reddit thread, but might as well do a feature request:

qBittorrent when it detects it can't write into the destination switches into an "upload only" mode

Would it be possible to add a similar feature/error handling path to BiglyBT?

I can see two possible levels (increasing level of complexity):

  1. Upload only mode on write error (to get a feature parity with qBittorrent).
  2. Shift the raising of the "write error" to the point of piece validation (attempt to just use the data from a read-only file and only on the mismatch switch the torrent into an error state)

If 2. got implemented it would mean you could do a kind of "immutable / "seed only" file mode" lite (using just the basic filesystem features - no mutable overlay layer on top), but even 1. would be very nice feature.

parg commented 2 weeks ago

It might be relatively easy to add an option that sets the download's "download speed limit" to "disabled" on detection of a write error. The user would need to manually remove this restriction when they wanted downloading to restart.

2peer commented 2 weeks ago

The user would need to manually remove this restriction when they wanted downloading to restart.

That would be completely fine by me.

2peer commented 2 weeks ago

By the way: Doesn't the speed limit of 0 have a special meaning (unlimited)?

Just went on to test it out manually, and ...

parg commented 2 weeks ago

internally 0 is unlimited, -1 is disabled

2peer commented 2 weeks ago

internally 0 is unlimited, -1 is disabled

And is there any UI for that?

I'm using the Classic interface and:

Maybe I should switch to Modern but tried it twice (once quite recently) and there were still a few annoyances that forced me to switch back (few additional options would probably fix those).

parg commented 2 weeks ago

right-click on a download, set download speed?

parg commented 2 weeks ago

ah, classic UI fail

2peer commented 2 weeks ago

Understood. Maintaining 2 different UIs must be headache. I think with a few additional user options (mostly to hide some unused features to save screens space & CPU cycles - be more "Classic like"), you could convert even the most die-hard Classic users. Might give it a try and report those later.

parg commented 2 weeks ago

Beta B21 has new option (disabled by default)

Options->Files: Switch download to 'upload only' (download speed->disabled) on disk write error

Tested a bit, report any issues.

I added the "disabled" speed limits to the Classic UI torrent menu.

2peer commented 2 weeks ago

Beta B21 has new option (disabled by default)

OK, testing.

One thing I noticed is that the torrents with a "Disable Download" speed limit are not visually distinguished in the overview (default visible column setup). Might be a good idea to do so somehow or users might be confused why their torrents are suddenly not downloading. Maybe a separate wording in the Status column like "Queued (upload only)", or color coding?

Also: If the "Max Download Speed" column is enabled it currently shows as -1024 B/s (on disabled downloads).

2peer commented 2 weeks ago

Might have an issue here: While not "downloading" per se it looks like the features of BiglyBT for exchange of similar data between torrents might be still at play. I see (on disk) partial downloads on files in delete state (the torrents max speed was -1 the whole time, this particular one I was testing before the beta and set the max speed manually).

I also got a weird read errors on linked files from the "Search for existing data files feature" (located on read-only filesystem). It mentioned a read-only filesystem as a cause but that shouldn't matter for a read operation. - I need to investigate this further.

2peer commented 2 weeks ago

BTW. There is an inconsistency in the display of the Path column in the Downloaded VS linked files.

  1. If file is internally linked it shows the full absolute path to the parent directory of the target file
  2. If the file is downloaded into the selected "Save In" path for the torrent it shows a relative path to that, but it's displayed as absolute (beginning with a /)

Case 2. should display the path starting with a . (so the base "Save In" dir would be either ./ or just .). There are no drive letters on Linux/UNIXESes so no way to distinguish visually on those, and I believe even on Windows the paths starting with a \ are absolute within the drive letter (might be mistaken).

2peer commented 2 weeks ago

Is there a way to copy the torrent Error messages out of Bigly? In both General and info tab they are clipped when they do not fit and there seems to be no way to copy-paste them. Read-only textfield would probably resolve that. The only way to show the whole message seems to be to extend the Status field in the "My Torrents" overview table. Am I missing someting?

2peer commented 2 weeks ago

Got this from the log:

{core} Stopped - state=100,error=5/Disk read error: open fails for '/read_only_path/filename', File not found: /read_only_path/filename (File system is read only)/0;   | Download: 'Torrent Name'

/read_only_path/filename is a valid file path previously obtained by using the "Search for existing data files" feature, and tested again (the file is there and readable).

Force-recheck validates the presence of the data/file content (so Bigly is able to read it sometimes), but once I start the torrent I get a similar error again.

2peer commented 2 weeks ago

Details (relevant exception):

 {stderr}   java.io.FileNotFoundException: /read_only_path/filename (File system is read only)
    at java.base/java.io.RandomAccessFile.open0(Native Method)
    at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:356)
    at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:273)
    at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:223)
    at com.biglybt.core.diskmanager.file.impl.FMFileAccessController$FileAccessorRAF.<init>(FMFileAccessController.java:578)
    at com.biglybt.core.util.FileHandler.newFileAccessor(FileHandler.java:80)
    at com.biglybt.core.util.FileUtil.newFileAccessor(FileUtil.java:4043)
    at com.biglybt.core.diskmanager.file.impl.FMFileImpl.openSupport(FMFileImpl.java:623)
    at com.biglybt.core.diskmanager.file.impl.FMFileImpl.ensureOpen(FMFileImpl.java:509)
    at com.biglybt.core.diskmanager.file.impl.FMFileLimited.ensureOpen(FMFileLimited.java:92)
    at com.biglybt.core.diskmanager.file.impl.FMFileLimited.write(FMFileLimited.java:332)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1100)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCacheSupport(CacheFileWithCache.java:967)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:829)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:1149)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCachePublic(CacheFileWithCache.java:1167)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.close(CacheFileWithCache.java:1936)
    at com.biglybt.core.disk.impl.DiskManagerImpl.stop(DiskManagerImpl.java:738)
    at com.biglybt.core.disk.impl.DiskManagerImpl$6.run(DiskManagerImpl.java:2278)
    at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:334)

Maybe file is being open RW even for plain read op. in some code path ? Just guessing...

"File system is read only" is my translation (it's a system message output according to my locale) - might not match the exact wording in LANG=en_US

2peer commented 2 weeks ago

For the one I actually left at unlimited download speed:

  1. It didn't switch to "Disable Upload" (but the feature was enabled in options)
  2. I got: Error: Resume data save fails: flush fails, open fails for '/read_only_path/filename', File not found: /read_only_path/filename (File system is read only)

Unfortunately didn't save the exception for that one in time.

2peer commented 2 weeks ago

OK, a few more:

[21:37:56.193] {stderr} DEBUG::Thu Jun 20 21:37:56 CEST 2024::com.biglybt.core.diskmanager.file.impl.FMFileImpl::openSupport::654:
[21:37:56.193] {stderr}   java.io.FileNotFoundException: /read_only_path/filename (File system is read only)
    at java.base/java.io.RandomAccessFile.open0(Native Method)
    at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:356)
    at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:273)
    at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:223)
    at com.biglybt.core.diskmanager.file.impl.FMFileAccessController$FileAccessorRAF.<init>(FMFileAccessController.java:578)
    at com.biglybt.core.util.FileHandler.newFileAccessor(FileHandler.java:80)
    at com.biglybt.core.util.FileUtil.newFileAccessor(FileUtil.java:4043)
    at com.biglybt.core.diskmanager.file.impl.FMFileImpl.openSupport(FMFileImpl.java:623)
    at com.biglybt.core.diskmanager.file.impl.FMFileImpl.ensureOpen(FMFileImpl.java:509)
    at com.biglybt.core.diskmanager.file.impl.FMFileLimited.ensureOpen(FMFileLimited.java:92)
    at com.biglybt.core.diskmanager.file.impl.FMFileLimited.write(FMFileLimited.java:332)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1100)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCacheSupport(CacheFileWithCache.java:1030)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:829)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:1149)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileManagerImpl.allocateCacheSpace(CacheFileManagerImpl.java:400)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.readCache(CacheFileWithCache.java:497)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.read(CacheFileWithCache.java:1804)
    at com.biglybt.core.diskmanager.access.impl.DiskAccessRequestImpl.runRequest(DiskAccessRequestImpl.java:102)
    at com.biglybt.core.diskmanager.access.impl.DiskAccessControllerInstance$requestDispatcher$1.run(DiskAccessControllerInstance.java:694)
    at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:334)

and

[21:38:13.682] {stderr}   com.biglybt.core.diskmanager.cache.CacheFileManagerException: flush fails
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1110)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCacheSupport(CacheFileWithCache.java:1030)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:829)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:1149)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileManagerImpl.allocateCacheSpace(CacheFileManagerImpl.java:400)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.readCache(CacheFileWithCache.java:497)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.read(CacheFileWithCache.java:1804)
    at com.biglybt.core.diskmanager.access.impl.DiskAccessRequestImpl.runRequest(DiskAccessRequestImpl.java:102)
    at com.biglybt.core.diskmanager.access.impl.DiskAccessControllerInstance$requestDispatcher$1.run(DiskAccessControllerInstance.java:694)
    at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:334)
Caused by: com.biglybt.core.diskmanager.file.FMFileManagerException: open fails for '/read_only_path/filename'
    at com.biglybt.core.diskmanager.file.impl.FMFileImpl.openSupport(FMFileImpl.java:656)
    at com.biglybt.core.diskmanager.file.impl.FMFileImpl.ensureOpen(FMFileImpl.java:509)
    at com.biglybt.core.diskmanager.file.impl.FMFileLimited.ensureOpen(FMFileLimited.java:92)
    at com.biglybt.core.diskmanager.file.impl.FMFileLimited.write(FMFileLimited.java:332)
    at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1100)
    ... 9 more
Caused by: java.io.FileNotFoundException: /read_only_path/filename (File system is read only)
    at java.base/java.io.RandomAccessFile.open0(Native Method)
    at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:356)
    at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:273)
    at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:223)
    at com.biglybt.core.diskmanager.file.impl.FMFileAccessController$FileAccessorRAF.<init>(FMFileAccessController.java:578)
    at com.biglybt.core.util.FileHandler.newFileAccessor(FileHandler.java:80)
    at com.biglybt.core.util.FileUtil.newFileAccessor(FileUtil.java:4043)
    at com.biglybt.core.diskmanager.file.impl.FMFileImpl.openSupport(FMFileImpl.java:623)
    ... 13 more
parg commented 2 weeks ago

The "download speed" column shows a "blocked" icon to distinguish it - I'll check the max-down column

parg commented 2 weeks ago

I check for write fails, not read-only file systems. Why would you download to a read-only file system?

parg commented 2 weeks ago

image

parg commented 2 weeks ago

(your -1024 is due to you setting the value manually to -1 in the torrent options view, which I've just fixed)

2peer commented 2 weeks ago

I check for write fails, not read-only file systems. Why would you download to a read-only file system?

I'm not trying to "download" to a read-only file system, just to seed from it (using the link feature). The torrents "Save to" location is still on the RW file system, just some of the files are linked targeting RO.

My motivations:

  1. Torrents containing a large collection of files, where I already own a part of them.
  2. The files can have a different names / directory structure
  3. BiglyBTs "Search for existing data files" with a "link" option helps to locate such a files & seed them / revive the torrent .... All that without the need to make a separate copy.
  4. My copy of those file is verified, but the torrent can contain a part of them slightly corrupted/modified (same size, but some pieces might have different hash). This could be due to slight change in metadata, or plain data corruption somewhere in the files history.
  5. Generally I would just really like to make sure that BiglyBT never writes to such a file (even by mistake). Read-only file system assures that, but there are many other methods to do so (file permissions, immutable attribute on the file ...), all of them will result in a failure of the write syscall.
  6. If point 2. from this feature-request also got implemented it would allow me (in many cases) to also download files i'm missing, because most of the time the files in the torrent are really the same. You just never know for sure - the change could be in an unverified piece on a file boundary.
  7. This requests point 1. enables partial seed-only mode (without a risk of corrupting your own data). That has a huge value on it's own.

I go into more detail about my motivations in the original reddit thread.

Why I think it should work:

  1. On read-only file system all the read operations are still permitted (so no need to check if fs is RW if we are only going to read from it).
  2. It's fine to check if the torrents "Save path" is still RW (to save partial files & other small meta-data needed by BiglyBT), but the linked files could (and often will be) RO (either file-system or other means).

I suspect the problem might be the open() syscall (requesting RW file access)? Those would probably need to fall back to RO (and revert to "upload only" mode as well).

BTW. How did you test/emulate the write-failure event originally? And what was your intended use-case? Was it just running out of space, faulty media, ...?

And one more note: The link to a file/sub-directory might not be internal to BiglyBT. It could be a symlink (Linux / UNIXes), or NTFS junction (windows). Just to break any more potential assumptions that could bite us later.

2peer commented 2 weeks ago

image

In Classic UI (dark theme) it's just an empty field, but that's my problem (for sticking with Classic).

parg commented 2 weeks ago

I was assuming out-of-space kind of scenarios. I've lashed things up to deal with read-only file systems somewhat in next beta.

2peer commented 2 weeks ago

I was assuming out-of-space kind of scenarios. I've lashed things up to deal with read-only file systems somewhat in next beta.

I'm looking at the commit ( getFileAccessor() method - READ_ACCESS_MODE fallback for the FileAccessor on switch_to_upload_only_enable).

Maybe it would be a good idea to also make sure that we can get only a READ_ACCESS_MODE FileAccessor when the torrent is already in "upload only" (Disable Download) mode? That way the user could be reasonably sure that BiglyBT won't write to any files (even when permitted to do so by the file system). It would also surface any potential issues of that sort.

2peer commented 2 weeks ago

Are they not the "Max Download Speed = -1" & "Disabled download" the same thing?

I see:

So there must be some additional associated state of the torrent?

2peer commented 2 weeks ago

Can report a first successful automatic switch to "No download" state (links to RO file system). No torrents in error state so far. Will see how the seeding will go.

parg commented 2 weeks ago

You manually set it to -1 in a KB/sec field, that was then mutipled up to -1024. Fixed in B22 but existing -1024 will stay until you change it

2peer commented 2 weeks ago

Ok. One more minor issue to report (tested on 3601_B22): Torrent that got switched to "upload only" automatically still generate the following 2 errors on BiglyBT exit (they show up in notifications on the next start):

That is kind of noisy (there is already the notification about switching to "upload only"), but more importantly 2 question arise:

Found a few other issues but they are not directly related => separate reports.

parg commented 2 weeks ago

I don't get any alerts on startup - upload the full details (including stack traces)

2peer commented 2 weeks ago

I don't get any alerts on startup - upload the full details (including stack traces)

I seem to get the following in regular intervals (after the torrent auto-switched to "upload only"). Taken from debug_1.log:


[16:22:06] [stderr] DEBUG::Mon Jun 24 16:22:06 CEST 2024::com.biglybt.core.disk.impl.access.impl.DMReaderImpl$requestDispatcher::failed::967:
[16:22:06] [stderr]   com.biglybt.core.diskmanager.cache.CacheFileManagerException: flush fails
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1110)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCacheSupport(CacheFileWithCache.java:1030)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:829)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:1149)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileManagerImpl.allocateCacheSpace(CacheFileManagerImpl.java:400)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.readCache(CacheFileWithCache.java:497)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.read(CacheFileWithCache.java:1804)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessRequestImpl.runRequest(DiskAccessRequestImpl.java:102)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessControllerInstance$requestDispatcher$1.run(DiskAccessControllerInstance.java:694)
        at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:334)
Caused by: com.biglybt.core.diskmanager.file.FMFileManagerException: write failed
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:543)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessController.write(FMFileAccessController.java:521)
        at com.biglybt.core.diskmanager.file.impl.FMFileImpl.writeSupport(FMFileImpl.java:859)
        at com.biglybt.core.diskmanager.file.impl.FMFileLimited.write(FMFileLimited.java:334)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1100)
        ... 9 more
Caused by: java.nio.channels.NonWritableChannelException
        at java.base/sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:321)
        at java.base/java.nio.channels.FileChannel.write(FileChannel.java:478)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:482)
        ... 13 more
[16:22:06] [stderr]
[16:22:06] [stderr] DEBUG::Mon Jun 24 16:22:06 CEST 2024::com.biglybt.core.disk.impl.access.impl.DMReaderImpl$requestDispatcher::failed::967:
[16:22:06] [stderr]   com.biglybt.core.diskmanager.cache.CacheFileManagerException: flush fails
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1110)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCacheSupport(CacheFileWithCache.java:1030)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:829)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:1149)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileManagerImpl.allocateCacheSpace(CacheFileManagerImpl.java:400)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.readCache(CacheFileWithCache.java:497)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.read(CacheFileWithCache.java:1804)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessRequestImpl.runRequest(DiskAccessRequestImpl.java:102)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessControllerInstance$requestDispatcher$1.run(DiskAccessControllerInstance.java:694)
        at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:334)
Caused by: com.biglybt.core.diskmanager.file.FMFileManagerException: write failed
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:543)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessController.write(FMFileAccessController.java:521)
        at com.biglybt.core.diskmanager.file.impl.FMFileImpl.writeSupport(FMFileImpl.java:859)
        at com.biglybt.core.diskmanager.file.impl.FMFileLimited.write(FMFileLimited.java:334)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1100)
        ... 9 more
Caused by: java.nio.channels.NonWritableChannelException
        at java.base/sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:321)
        at java.base/java.nio.channels.FileChannel.write(FileChannel.java:478)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:482)
        ... 13 more

[16:25:10] [stderr] DEBUG::Mon Jun 24 16:25:10 CEST 2024::com.biglybt.core.disk.impl.access.impl.DMReaderImpl$requestDispatcher::failed::967:
[16:25:10] [stderr]   com.biglybt.core.diskmanager.cache.CacheFileManagerException: flush fails
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1110)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCacheSupport(CacheFileWithCache.java:1030)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:829)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:1149)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileManagerImpl.allocateCacheSpace(CacheFileManagerImpl.java:400)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.readCache(CacheFileWithCache.java:497)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.read(CacheFileWithCache.java:1804)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessRequestImpl.runRequest(DiskAccessRequestImpl.java:102)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessControllerInstance$requestDispatcher$1.run(DiskAccessControllerInstance.java:694)
        at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:334)
Caused by: com.biglybt.core.diskmanager.file.FMFileManagerException: write failed
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:543)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessController.write(FMFileAccessController.java:521)
        at com.biglybt.core.diskmanager.file.impl.FMFileImpl.writeSupport(FMFileImpl.java:859)
        at com.biglybt.core.diskmanager.file.impl.FMFileLimited.write(FMFileLimited.java:334)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1100)
        ... 9 more
Caused by: java.nio.channels.NonWritableChannelException
        at java.base/sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:321)
        at java.base/java.nio.channels.FileChannel.write(FileChannel.java:478)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:482)
        ... 13 more
[16:25:10] [stderr]
[16:25:10] [stderr] DEBUG::Mon Jun 24 16:25:10 CEST 2024::com.biglybt.core.disk.impl.access.impl.DMReaderImpl$requestDispatcher::failed::967:
[16:25:10] [stderr]   com.biglybt.core.diskmanager.cache.CacheFileManagerException: flush fails
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1110)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCacheSupport(CacheFileWithCache.java:1030)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:829)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:1149)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileManagerImpl.allocateCacheSpace(CacheFileManagerImpl.java:400)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.readCache(CacheFileWithCache.java:497)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.read(CacheFileWithCache.java:1804)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessRequestImpl.runRequest(DiskAccessRequestImpl.java:102)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessControllerInstance$requestDispatcher$1.run(DiskAccessControllerInstance.java:694)
        at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:334)
Caused by: com.biglybt.core.diskmanager.file.FMFileManagerException: write failed
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:543)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessController.write(FMFileAccessController.java:521)
        at com.biglybt.core.diskmanager.file.impl.FMFileImpl.writeSupport(FMFileImpl.java:859)
        at com.biglybt.core.diskmanager.file.impl.FMFileLimited.write(FMFileLimited.java:334)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1100)
        ... 9 more
Caused by: java.nio.channels.NonWritableChannelException
        at java.base/sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:321)
        at java.base/java.nio.channels.FileChannel.write(FileChannel.java:478)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:482)
        ... 13 more
[16:25:10] [stderr]

[16:28:11] [stderr] DEBUG::Mon Jun 24 16:28:11 CEST 2024::com.biglybt.core.disk.impl.access.impl.DMReaderImpl$requestDispatcher::failed::967:
[16:28:11] [stderr]   com.biglybt.core.diskmanager.cache.CacheFileManagerException: flush fails
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1110)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCacheSupport(CacheFileWithCache.java:1030)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:829)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:1149)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileManagerImpl.allocateCacheSpace(CacheFileManagerImpl.java:400)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.readCache(CacheFileWithCache.java:497)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.read(CacheFileWithCache.java:1804)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessRequestImpl.runRequest(DiskAccessRequestImpl.java:102)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessControllerInstance$requestDispatcher$1.run(DiskAccessControllerInstance.java:694)
        at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:334)
Caused by: com.biglybt.core.diskmanager.file.FMFileManagerException: write failed
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:543)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessController.write(FMFileAccessController.java:521)
        at com.biglybt.core.diskmanager.file.impl.FMFileImpl.writeSupport(FMFileImpl.java:859)
        at com.biglybt.core.diskmanager.file.impl.FMFileLimited.write(FMFileLimited.java:334)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1100)
        ... 9 more
Caused by: java.nio.channels.NonWritableChannelException
        at java.base/sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:321)
        at java.base/java.nio.channels.FileChannel.write(FileChannel.java:478)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:482)
        ... 13 more
[16:28:11] [stderr]
[16:28:11] [stderr] DEBUG::Mon Jun 24 16:28:11 CEST 2024::com.biglybt.core.disk.impl.access.impl.DMReaderImpl$requestDispatcher::failed::967:
[16:28:11] [stderr]   com.biglybt.core.diskmanager.cache.CacheFileManagerException: flush fails
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1110)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCacheSupport(CacheFileWithCache.java:1030)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:829)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:1149)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileManagerImpl.allocateCacheSpace(CacheFileManagerImpl.java:400)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.readCache(CacheFileWithCache.java:497)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.read(CacheFileWithCache.java:1804)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessRequestImpl.runRequest(DiskAccessRequestImpl.java:102)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessControllerInstance$requestDispatcher$1.run(DiskAccessControllerInstance.java:694)
        at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:334)
Caused by: com.biglybt.core.diskmanager.file.FMFileManagerException: write failed
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:543)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessController.write(FMFileAccessController.java:521)
        at com.biglybt.core.diskmanager.file.impl.FMFileImpl.writeSupport(FMFileImpl.java:859)
        at com.biglybt.core.diskmanager.file.impl.FMFileLimited.write(FMFileLimited.java:334)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1100)
        ... 9 more
Caused by: java.nio.channels.NonWritableChannelException
        at java.base/sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:321)
        at java.base/java.nio.channels.FileChannel.write(FileChannel.java:478)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:482)
        ... 13 more
[16:28:11] [stderr]

...

[19:02:17] [stderr]
[19:02:43] [stderr] DEBUG::Mon Jun 24 19:02:43 CEST 2024::com.biglybt.core.disk.impl.access.impl.DMReaderImpl$requestDispatcher::failed::967:
[19:02:43] [stderr]   com.biglybt.core.diskmanager.cache.CacheFileManagerException: flush fails
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1110)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCacheSupport(CacheFileWithCache.java:1030)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:829)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:1149)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileManagerImpl.allocateCacheSpace(CacheFileManagerImpl.java:400)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.readCache(CacheFileWithCache.java:497)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.read(CacheFileWithCache.java:1804)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessRequestImpl.runRequest(DiskAccessRequestImpl.java:102)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessControllerInstance$requestDispatcher$1.run(DiskAccessControllerInstance.java:694)
        at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:334)
Caused by: com.biglybt.core.diskmanager.file.FMFileManagerException: write failed
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:543)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessController.write(FMFileAccessController.java:521)
        at com.biglybt.core.diskmanager.file.impl.FMFileImpl.writeSupport(FMFileImpl.java:859)
        at com.biglybt.core.diskmanager.file.impl.FMFileLimited.write(FMFileLimited.java:334)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1100)
        ... 9 more
Caused by: java.nio.channels.NonWritableChannelException
        at java.base/sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:321)
        at java.base/java.nio.channels.FileChannel.write(FileChannel.java:478)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:482)
        ... 13 more
[19:02:43] [stderr]
[19:02:43] [stderr] DEBUG::Mon Jun 24 19:02:43 CEST 2024::com.biglybt.core.disk.impl.access.impl.DMReaderImpl$requestDispatcher::failed::967:
[19:02:43] [stderr]   com.biglybt.core.diskmanager.cache.CacheFileManagerException: flush fails
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1110)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCacheSupport(CacheFileWithCache.java:1030)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:829)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:1149)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileManagerImpl.allocateCacheSpace(CacheFileManagerImpl.java:400)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.readCache(CacheFileWithCache.java:497)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.read(CacheFileWithCache.java:1804)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessRequestImpl.runRequest(DiskAccessRequestImpl.java:102)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessControllerInstance$requestDispatcher$1.run(DiskAccessControllerInstance.java:694)
        at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:334)
Caused by: com.biglybt.core.diskmanager.file.FMFileManagerException: write failed
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:543)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessController.write(FMFileAccessController.java:521)
        at com.biglybt.core.diskmanager.file.impl.FMFileImpl.writeSupport(FMFileImpl.java:859)
        at com.biglybt.core.diskmanager.file.impl.FMFileLimited.write(FMFileLimited.java:334)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1100)
        ... 9 more
Caused by: java.nio.channels.NonWritableChannelException
        at java.base/sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:321)
        at java.base/java.nio.channels.FileChannel.write(FileChannel.java:478)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:482)
        ... 13 more
[19:02:43] [stderr]
[19:02:43] [stderr] DEBUG::Mon Jun 24 19:02:43 CEST 2024::com.biglybt.core.disk.impl.access.impl.DMReaderImpl$requestDispatcher::failed::967:
[19:02:43] [stderr]   com.biglybt.core.diskmanager.cache.CacheFileManagerException: flush fails
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1110)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCacheSupport(CacheFileWithCache.java:1030)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:829)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.flushCache(CacheFileWithCache.java:1149)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileManagerImpl.allocateCacheSpace(CacheFileManagerImpl.java:400)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.readCache(CacheFileWithCache.java:497)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.read(CacheFileWithCache.java:1804)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessRequestImpl.runRequest(DiskAccessRequestImpl.java:102)
        at com.biglybt.core.diskmanager.access.impl.DiskAccessControllerInstance$requestDispatcher$1.run(DiskAccessControllerInstance.java:694)
        at com.biglybt.core.util.AEThread2$threadWrapper.run(AEThread2.java:334)
Caused by: com.biglybt.core.diskmanager.file.FMFileManagerException: write failed
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:543)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessController.write(FMFileAccessController.java:521)
        at com.biglybt.core.diskmanager.file.impl.FMFileImpl.writeSupport(FMFileImpl.java:859)
        at com.biglybt.core.diskmanager.file.impl.FMFileLimited.write(FMFileLimited.java:334)
        at com.biglybt.core.diskmanager.cache.impl.CacheFileWithCache.multiBlockFlush(CacheFileWithCache.java:1100)
        ... 9 more
Caused by: java.nio.channels.NonWritableChannelException
        at java.base/sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:321)
        at java.base/java.nio.channels.FileChannel.write(FileChannel.java:478)
        at com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear.write(FMFileAccessLinear.java:482)
        ... 13 more
[19:02:43] [stderr]

Then on exit:

[19:13:13] [alert] Alert:3:<torrent_name>: File close fails: flush fails, write failed, NonWritableChannelException
[19:13:13] [alert] Alert:3:<torrent_name>: Resume data save fails: flush fails, write failed, NonWritableChannelException

Interestingly no similar stack trace with a timestamp matching that alert.

parg commented 2 weeks ago

See if B24's any better

2peer commented 2 weeks ago

Seems OK. CacheFileManagerException only in the moment of switching to "upload only" (as expected) and no more alerts on exit/restart.

parg commented 1 week ago

I'll close it, open another issue if there's any significant problems