Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbbot doesn't work in solaris #11

Open
leng1987 opened this issue Mar 10, 2014 · 2 comments
Open

dbbot doesn't work in solaris #11

leng1987 opened this issue Mar 10, 2014 · 2 comments

Comments

@leng1987
Copy link

I'm using Solaris on x86 machine and copy DbBot-master to ~/pkgs.
The version of RF is 2.8.4 and the version of Python is 2.7.2

I go to the folder ~/pkgs/DbBot-master/bin and execute the command ./dbbot ~/yqleng_20140309_225128_output.xml (This file is generated by pybot. Please get it in the attachment.)

Then there is some error returned as below:
Traceback (most recent call last):
File "./dbbot", line 52, in
DbBot().run()
File "./dbbot", line 32, in init
self._db = DatabaseWriter(database_path, verbose_stream)
File "/home/users/yqleng/pkgs/DbBot-master/dbbot/reader/database_writer.py", line 21, in init
self._init_schema()
File "/home/users/yqleng/pkgs/DbBot-master/dbbot/reader/database_writer.py", line 25, in _init_schema
self._create_table_test_runs()
File "/home/users/yqleng/pkgs/DbBot-master/dbbot/reader/database_writer.py", line 46, in _create_table_test_runs
}, ('hash',))
File "/home/users/yqleng/pkgs/DbBot-master/dbbot/reader/database_writer.py", line 161, in _create_table
self._connection.execute(sql_statement)
sqlite3.OperationalError: disk I/O error.

Please note:
I tried the same SQL in python as below and it works:

import sqlite3
con=sqlite3.connect("./file.db")
cur=con.cursor()
cur.execute("CREATE TABLE IF NOT EXISTS test_runs (id INTEGER PRIMARY KEY, started_at DATETIME, finished_at DATETIME, source_file TEXT, hash TEXT NOT NULL, imported_at DATETIME NOT NULL, CONSTRAINT unique_test_runs UNIQUE (hash))")
<sqlite3.Cursor object at 0x28c160>

I also tried in Window7 and dbbot worked well and generated the file robot_results.db.

@leng1987
Copy link
Author

I think I have found the root cause: https://sqlite.org/faq.html#q5

SQLite uses reader/writer locks to control access to the database...But use caution: this locking mechanism might not work correctly if the database file is kept on an NFS filesystem. This is because fcntl() file locking is broken on many NFS implementations...

My question is how to avoid the reader/writer locks in dbbot source code because I can make sure that there is no concurrency recently in my applications.

@Tattoo
Copy link
Contributor

Tattoo commented Mar 10, 2014

Quickly looking, this seems to be the root cause.

Usage of reader/writer locks depend solely on the way Python's sqlite-module is implemented. Therefore the workaround for avoiding locks is to avoid NFS as a file system. This is however far less than ideal.

Another option is to make possible to use dbbot with different databases, as detailed in issue #7 . Another database might work better on NFS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants