Fix Songs can hang if any tasks are cancelled because timeout triggered

Description

Fix Songs can hang if any tasks are cancelled because timeout triggered, thi is due to H2 bug 227 - https://github.com/h2database/h2database/issues/227

{{Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.IllegalStateException: Reading from nio:/Users/Stuart/Library/Preferences/SongKong/Database/Database.mv.db failed; file length -1 read length 384 at 444654080 [1.4.199/1]"; SQL statement:
select this_.recNo as recNo1_17_1_, this_.acoustic as acoustic2_17_1_, this_.acoustidFingerprint as acoustid3_17_1_, this_.acoustidId as acoustid4_17_1_, this_.album as album5_17_1_, this_.albumArtist as albumArt6_17_1_, this_.albumArtistSort as albumArt7_17_1_, this_.albumArtists as albumArt8_17_1_, this_.albumArtistsSort as albumArt9_17_1_, this_.albumSort as albumSo10_17_1_, this_.amazonId as amazonI11_17_1_, this_.arranger as arrange12_17_1_, this_.arrangerSort as arrange13_17_1_, this_.artist as artist14_17_1_, this_.artistSort as artistS15_17_1_, this_.artists as artists16_17_1_, this_.artistsSort as artists17_17_1_, this_.audioBitRate as audioBi18_17_1_, this_.audioBitsPerSample as audioBi19_17_1_, this_.audioEncoder as audioEn20_17_1_, this_.audioFormat as audioFo21_17_1_, this_.audioSampleRate as audioSa22_17_1_, this_.barcode as barcode23_17_1_, this_.bpm as bpm24_17_1_, this_.catalogNo as catalog25_17_1_, this_.choir as choir26_17_1_, this_.choirSort as choirSo27_17_1_, this_.classicalCatalog as classic28_17_1_, this_.classicalNickname as classic29_17_1_, this_.comment as comment30_17_1_, this_.composer as compose31_17_1_, this_.composerSort as compose32_17_1_, this_.conductor as conduct33_17_1_, this_.conductorSort as conduct34_17_1_, this_.country as country35_17_1_, this_.custom1 as custom36_17_1_, this_.custom2 as custom37_17_1_, this_.custom3 as custom38_17_1_, this_.custom4 as custom39_17_1_, this_.custom5 as custom40_17_1_, this_.discNo as discNo41_17_1_, this_.discSubtitle as discSub42_17_1_, this_.discTotal as discTot43_17_1_, this_.djmixer as djmixer44_17_1_, this_.duration as duratio45_17_1_, this_.electronic as electro46_17_1_, this_.encoder as encoder47_17_1_, this_.engineer as enginee48_17_1_, this_.ensemble as ensembl49_17_1_, this_.ensembleSort as ensembl50_17_1_, this_.fbpm as fbpm51_17_1_, this_.fileSuffix as fileSuf52_17_1_, this_.filename as filenam53_17_1_, this_.filesize as filesiz54_17_1_, this_.genre as genre55_17_1_, this_.grouping as groupin56_17_1_, this_.instrument as instrum57_17_1_, this_.instrumental as instrum58_17_1_, this_.isClassical as isClass59_17_1_, this_.isCompilation as isCompi60_17_1_, this_.isGreatestHits as isGreat61_17_1_, this_.isHd as isHd62_17_1_, this_.isSoundtrack as isSound63_17_1_, this_.isrc as isrc64_17_1_, this_.keyOfSong as keyOfSo65_17_1_, this_.language as languag66_17_1_, this_.lastModified as lastMod67_17_1_, this_.lyricist as lyricis68_17_1_, this_.lyricistSort as lyricis69_17_1_, this_.lyrics as lyrics70_17_1_, this_.matched as matched71_17_1_, this_.media as media72_17_1_, this_.minimServerGroup as minimSe73_17_1_, this_.mixer as mixer74_17_1_, this_.mood as mood75_17_1_, this_.moodAggressive as moodAgg76_17_1_, this_.moodArousal as moodAro77_17_1_, this_.moodDanceability as moodDan78_17_1_, this_.moodHappy as moodHap79_17_1_, this_.moodParty as moodPar80_17_1_, this_.moodRelaxed as moodRel81_17_1_, this_.moodSad as moodSad82_17_1_, this_.moodValence as moodVal83_17_1_, this_.movement as movemen84_17_1_, this_.movementNo as movemen85_17_1_, this_.movementTotal as movemen86_17_1_, this_.musicbrainzArtistId as musicbr87_17_1_, this_.musicbrainzDiscId as musicbr88_17_1_, this_.musicbrainzOriginalReleaseId as musicbr89_17_1_, this_.musicbrainzRecordingId as musicbr90_17_1_, this_.musicbrainzReleaseArtistId as musicbr91_17_1_, this_.musicbrainzReleaseCountry as musicbr92_17_1_, this_.musicbrainzReleaseGroupId as musicbr93_17_1_, this_.musicbrainzReleaseId as musicbr94_17_1_, this_.musicbrainzReleaseStatus as musicbr95_17_1_, this_.musicbrainzReleaseTrackId as musicbr96_17_1_, this_.musicbrainzReleaseType as musicbr97_17_1_, this_.musicbrainzWork as musicbr98_17_1_, this_.musicbrainzWorkId as musicbr99_17_1_, this_.musicbrainzWorkPartOfLevel0Id as musicb100_17_1_, this_.musicbrainzWorkPartOfLevel1Id as musicb101_17_1_, this_.musicbrainzWorkPartOfLevel2Id as musicb102_17_1_, this_.musicbrainzWorkPartOfLevel3Id as musicb103_17_1_, this_.musicbrainzWorkPartOfLevel4Id as musicb104_17_1_, this_.musicbrainzWorkPartOfLevel5Id as musicb105_17_1_, this_.musicbrainzWorkPartOfLevel6Id as musicb106_17_1_, this_.musicipId as musici107_17_1_, this_.newFilename as newFil108_17_1_, this_.occasion as occasi109_17_1_, this_.opus as opus110_17_1_, this_.orchestra as orches111_17_1_, this_.orchestraSort as orches112_17_1_, this_.origFilename as origFi113_17_1_, this_.originalAlbum as origin114_17_1_, this_.originalArtist as origin115_17_1_, this_.originalLyricist as origin116_17_1_, this_.originalYear as origin117_17_1_, this_.overallWork as overal118_17_1_, this_.part as part119_17_1_, this_.partNumber as partNu120_17_1_, this_.partType as partTy121_17_1_, this_.performer as perfor122_17_1_, this_.performerName as perfor123_17_1_, this_.performerNameSort as perfor124_17_1_, this_.period as period125_17_1_, this_.producer as produc126_17_1_, this_.quality as qualit127_17_1_, this_.ranking as rankin128_17_1_, this_.rating as rating129_17_1_, this_.recordLabel as record130_17_1_, this_.releaseYear as releas131_17_1_, this_.remixer as remixe132_17_1_, this_.scratch as scratc133_17_1_, this_.script as script134_17_1_, this_.singleDiscTrackNo as single135_17_1_, this_.subtitle as subtit136_17_1_, this_.tags as tags137_17_1_, this_.tempo as tempo138_17_1_, this_.timbre as timbre139_17_1_, this_.title as title140_17_1_, this_.titleSort as titleS141_17_1_, this_.tonality as tonali142_17_1_, this_.track as track143_17_1_, this_.trackTotal as trackT144_17_1_, this_.urlDiscogsArtistSite as urlDis145_17_1_, this_.urlDiscogsReleaseSite as urlDis146_17_1_, this_.urlLyricsSite as urlLyr147_17_1_, this_.urlOfficialArtistSite as urlOff148_17_1_, this_.urlOfficialReleaseSite as urlOff149_17_1_, this_.urlWikipediaArtistSite as urlWik150_17_1_, this_.urlWikipediaReleaseSite as urlWik151_17_1_, this_.version as versio152_17_1_, this_.work as work153_17_1_, this_.workComposition as workCo154_17_1_, this_.workPartOfLevel1 as workPa155_17_1_, this_.workPartOfLevel1IdType as workPa156_17_1_, this_.workPartOfLevel2 as workPa157_17_1_, this_.workPartOfLevel2IdType as workPa158_17_1_, this_.workPartOfLevel3 as workPa159_17_1_, this_.workPartOfLevel3IdType as workPa160_17_1_, this_.workPartOfLevel4 as workPa161_17_1_, this_.workPartOfLevel4IdType as workPa162_17_1_, this_.workPartOfLevel5 as workPa163_17_1_, this_.workPartOfLevel5IdType as workPa164_17_1_, this_.workPartOfLevel6 as workPa165_17_1_, this_.workPartOfLevel6IdType as workPa166_17_1_, this_.workType as workTy167_17_1_, coverarts2_.recNo as recNo7_17_3_, coverarts2_.id as id1_1_3_, coverarts2_.id as id1_1_0_, coverarts2_.dataKey as dataKey2_1_0_, coverarts2_.description as descript3_1_0_, coverarts2_.imageType as imageTyp4_1_0_, coverarts2_.version as version5_1_0_, coverarts2_.width as width6_1_0_ from Song this_ left outer join CoverArt coverarts2_ on this_.recNo=coverarts2_.recNo where this_.recNo in order by this_.recNo asc [50000-199]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:502)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:194)
at org.h2.message.DbException.convert(DbException.java:347)
at org.h2.command.Command.executeQuery(Command.java:219)
at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:115)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:116)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:82)
... 21 more
Caused by: java.lang.IllegalStateException: Reading from nio:/Users/Stuart/Library/Preferences/SongKong/Database/Database.mv.db failed; file length -1 read length 384 at 444654080 [1.4.199/1]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:883)
at org.h2.mvstore.DataUtils.readFully(DataUtils.java:420)
at org.h2.mvstore.FileStore.readFully(FileStore.java:98)
at org.h2.mvstore.MVStore.readBufferForPage(MVStore.java:1048)
at org.h2.mvstore.MVStore.readPage(MVStore.java:2186)
at org.h2.mvstore.MVMap.readPage(MVMap.java:554)
at org.h2.mvstore.Page$NonLeaf.getChildPage(Page.java:1086)
at org.h2.mvstore.Cursor.traverseDown(Cursor.java:165)
at org.h2.mvstore.Cursor.<init>(Cursor.java:31)
at org.h2.mvstore.tx.TransactionMap$TMIterator.<init>(TransactionMap.java:701)
at org.h2.mvstore.tx.TransactionMap$EntryIterator.<init>(TransactionMap.java:664)
at org.h2.mvstore.tx.TransactionMap.entryIterator(TransactionMap.java:586)
at org.h2.mvstore.db.MVPrimaryIndex.find(MVPrimaryIndex.java:418)
at org.h2.mvstore.db.MVDelegateIndex.find(MVDelegateIndex.java:83)
at org.h2.index.BaseIndex.find(BaseIndex.java:132)
at org.h2.index.IndexCursor.find(IndexCursor.java:163)
at org.h2.table.TableFilter.next(TableFilter.java:475)
at org.h2.command.dml.Select$LazyResultQueryFlat.fetchNextRow(Select.java:1882)
at org.h2.result.LazyResult.hasNext(LazyResult.java:101)
at org.h2.result.LazyResult.next(LazyResult.java:60)
at org.h2.command.dml.Select.queryFlat(Select.java:742)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:884)
at org.h2.command.dml.Query.queryWithoutCacheLazyCheck(Query.java:151)
at org.h2.command.dml.Query.query(Query.java:435)
at org.h2.command.dml.Query.query(Query.java:397)
at org.h2.command.CommandContainer.query(CommandContainer.java:145)
at org.h2.command.Command.executeQuery(Command.java:202)
... 24 more
Caused by: java.nio.channels.ClosedChannelException
at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:110)
at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:721)
at org.h2.store.fs.FileNio.read(FilePathNio.java:74)
at org.h2.mvstore.DataUtils.readFully(DataUtils.java:406)
... 49 more
}}

Environment

None

Status

Assignee

Unassigned

Reporter

IJabz

Labels

None

Forum Username

ijabz

os

None

Components

Fix versions

Affects versions

6.3

Priority

Major
Configure