{"action":"created","issue":{"url":"https://api.github.com/repos/mwild1/luadbi/issues/37","repository_url":"https://api.github.com/repos/mwild1/luadbi","labels_url":"https://api.github.com/repos/mwild1/luadbi/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/mwild1/luadbi/issues/37/comments","events_url":"https://api.github.com/repos/mwild1/luadbi/issues/37/events","html_url":"https://github.com/mwild1/luadbi/issues/37","id":185472018,"number":37,"title":"missing locks on SQLite3 DB file and WAL shm file","user":{"login":"woffs","id":895853,"avatar_url":"https://avatars.githubusercontent.com/u/895853?v=3","gravatar_id":"","url":"https://api.github.com/users/woffs","html_url":"https://github.com/woffs","followers_url":"https://api.github.com/users/woffs/followers","following_url":"https://api.github.com/users/woffs/following{/other_user}","gists_url":"https://api.github.com/users/woffs/gists{/gist_id}","starred_url":"https://api.github.com/users/woffs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woffs/subscriptions","organizations_url":"https://api.github.com/users/woffs/orgs","repos_url":"https://api.github.com/users/woffs/repos","events_url":"https://api.github.com/users/woffs/events{/privacy}","received_events_url":"https://api.github.com/users/woffs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-26T18:24:44Z","updated_at":"2016-11-22T13:47:58Z","closed_at":null,"body":"With luadbi and SQLite3 and pragma journal_mode=wal, there is no lock set on the DB file and the -shm file. Other processes using non-lua libraries accessing the DB do not notice that the DB is still in use and remove the WAL related files, leading to possible DB corruption or data loss. I experienced this running prosody-trunk on Debian Jessie.\n\nWith the non-lua sqlite3 commandline client, with pragma journal_mode=wal, the sqlite DB file (and the wal related -shm file) are locked with a read lock. When concurrent processes access the same DB, the temporary -wal and -shm files are remove not earlier than the last client removed its lock.\n"},"comment":{"url":"https://api.github.com/repos/mwild1/luadbi/issues/comments/262244490","html_url":"https://github.com/mwild1/luadbi/issues/37#issuecomment-262244490","issue_url":"https://api.github.com/repos/mwild1/luadbi/issues/37","id":262244490,"user":{"login":"woffs","id":895853,"avatar_url":"https://avatars.githubusercontent.com/u/895853?v=3","gravatar_id":"","url":"https://api.github.com/users/woffs","html_url":"https://github.com/woffs","followers_url":"https://api.github.com/users/woffs/followers","following_url":"https://api.github.com/users/woffs/following{/other_user}","gists_url":"https://api.github.com/users/woffs/gists{/gist_id}","starred_url":"https://api.github.com/users/woffs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woffs/subscriptions","organizations_url":"https://api.github.com/users/woffs/orgs","repos_url":"https://api.github.com/users/woffs/repos","events_url":"https://api.github.com/users/woffs/events{/privacy}","received_events_url":"https://api.github.com/users/woffs/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T13:47:58Z","updated_at":"2016-11-22T13:47:58Z","body":"https://prosody.im/issues/issue/784"}}
{"actor":{"display_login":"woffs"}}