How different is threading in the ios driver betwe...
# squarelibraries
s
How different is threading in the ios driver between sqldelight 2.0 from 1.5.x? I just updated our app and we seem to be getting killed by watchdog on ios. In the crash log i can see that several threads are blocked on executing some db queries. It looks like we have some ui code that blocks on a db access, triggering watchdog. (We should of course not make ui block on db, but the issue seem to be a deadlock or simlar in db access) I know an issue with write-read ordering has been fixed (https://github.com/cashapp/sqldelight/issues/2808) so I guess the ios driver is a bit more strict, but does anyone know what's going on? Just start removing some transactions we added due to the 2808 bug and try again?
Copy code
"Elapsed total CPU time (seconds): 11.190 (user 11.190, system 0.000), 19% CPU",
"Elapsed application CPU time (seconds): 0.025, 0% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>
 
...

Thread 9 name:   Dispatch queue: com.apple.root.default-qos
Thread 9:
0   libsystem_kernel.dylib        	       0x1fc2d4558 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x21d11c078 _pthread_cond_wait + 1232
2   watch                         	       0x109cb1ea4 kfun:app.cash.sqldelight.driver.native.util.PoolLock.CriticalSection#loopForConditionalResult(kotlin.Function0<0:0?>){0§<kotlin.Any?>}0:0 + 624
3   watch                         	       0x109cbc1d8 kfun:app.cash.sqldelight.driver.native.Pool.borrowEntry$lambda$2#internal + 1448
4   watch                         	       0x109cbc28c kfun:app.cash.sqldelight.driver.native.Pool.$borrowEntry$lambda$2$FUNCTION_REFERENCE$1.invoke#internal + 108
5   watch                         	       0x109cb1448 kfun:app.cash.sqldelight.driver.native.util.PoolLock#withLock(kotlin.Function1<app.cash.sqldelight.driver.native.util.PoolLock.CriticalSection,0:0>){0§<kotlin.Any?>}0:0 + 644
6   watch                         	       0x109cba474 kfun:app.cash.sqldelight.driver.native.Pool#borrowEntry(){}app.cash.sqldelight.driver.native.Borrowed<1:0> + 856
7   watch                         	       0x109cba714 kfun:app.cash.sqldelight.driver.native.Pool#access(kotlin.Function1<1:0,0:0>){0§<kotlin.Any?>}0:0 + 212
8   watch                         	       0x109cb5630 kfun:app.cash.sqldelight.driver.native.NativeSqliteDriver#accessConnection(kotlin.Boolean;kotlin.Function1<app.cash.sqldelight.driver.native.ThreadConnection,0:0>){0§<kotlin.Any?>}0:0 + 672
9   watch                         	       0x109cb2234 kfun:app.cash.sqldelight.driver.native.ConnectionWrapper.accessStatement#internal + 376
10  watch                         	       0x109cb2548 kfun:app.cash.sqldelight.driver.native.ConnectionWrapper#executeQuery(<http://kotlin.Int?;kotlin.String;kotlin.Function1<app.cash.sqldelight.db.SqlCursor,app.cash.sqldelight.db.QueryResult<0:0>>;kotlin.Int;kotlin.Function1<app.cash.sqldelight.db.SqlPreparedStatement,kotlin.Unit>?|kotlin.Int?;kotlin.String;kotlin.Function1<app.cash.sqldelight.db.SqlCursor,app.cash.sqldelight.db.QueryResult<0:0>>;kotlin.Int;kotlin.Function1<app.cash.sqldelight.db.SqlPreparedStatement,kotlin.Unit>?>){0§<kotlin.Any?>}app.cash.sqldelight.db.QueryResult<0:0> + 344