On 05/07/2017 12:21 AM, Philip Warner wrote:
Not full, several gb free.

Will turn on logging and hope it plays well with Android.

Is it likely to be a threading issue? If so, will the logging show other 
accesses to the file?



The log most likely won't show too much other than the strerror() text.

It might be a threads-related error I suppose. I wouldn't jump straight to that though.

SQLITE_IOERR_FSYNC means just that - an fsync() call failed. There are only a couple of reasons for that - invalid file descriptor (some other module calling close() on our fd?), a real IO error (dodgy phone/SD card, have you seen this on more than one device?), or perhaps the fd is actually a socket (hardly seems likely if you got all the way to fsync() without some other error).

Dan.






On 7 May 2017 2:13:28 am AEST, Dan Kennedy <danielk1...@gmail.com> wrote:
On 05/06/2017 02:13 PM, Philip Warner wrote:
I have an Android app that does work in the database every five
minutes (at least). Every few days I am seeing:

     org.sqlite.database.sqlite.SQLiteDiskIOException: disk I/O error
(code 1034)

Code 1034 is SQLITE_IOERR_FSYNC.

This is using a custom build of the Sqlite bindings but I should note
that this also occurred under the vanilla build as well as in
SqlCipher.
This leads me to believe it's a problem with the underlying code (or
my use of it).

The app has multiple threads. It's always a background thread that
throws this error.

I believe that the specific Sqlite3 api being called in sqlite3_step,
but can not be sure. The android stack trace is:

Caused by: org.sqlite.database.sqlite.SQLiteDiskIOException: disk I/O
error (code 1034)
at

org.sqlite.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native

Method)
at

org.sqlite.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:776)
at

org.sqlite.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:759)
at

org.sqlite.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:68)
at net.philipwarner.platforms.android

<http://net.philipwarner.platforms.android>.sqlitenative.NativeStatement.execute(NativeStatement.java:74)
Any comments or thoughts on what this might mean? Fsync in multiple
threads? Fysnc while doing IO elsewhere?
Is the storage media very close to full?

If you are able to enable sqlite3_log() output (see docs for
SQLITE_CONFIG_LOG) it will log a message identifying the file that the
fsync() failed on. And the output of strerror().

Dan.



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to