GNOME Bugzilla – Bug 337724
JobScheduler
Last modified: 2007-06-23 10:24:54 UTC
Here's my WorkerThread + threaded database patch. It provides _massive_ speedups for people working with XMP metadata enabled and it adds infrastructure needed to do background tasks in a safe and non-blocking way. More info can be found here: http://mail.gnome.org/archives/f-spot-list/2006-April/msg00019.html
Created attachment 62983 [details] [review] f-spot-async-database.patch Slightly improved version over the one posted on the mailing list. More speedups everywhere and a fix for bug 327107. ChangeLog | 24 +++ src/Core.cs | 9 + src/Db.cs | 338 ++++++++++++++++++++++++++++++++++++++++++---------- src/ImportStore.cs | 53 +------- src/MainWindow.cs | 109 +++++++--------- src/Makefile.am | 1 src/MetaStore.cs | 69 ++-------- src/PhotoStore.cs | 255 ++++++++++++--------------------------- src/TagCommands.cs | 3 src/TagStore.cs | 66 ++++------ src/Updater.cs | 40 +----- src/WorkerThread.cs | 198 ++++++++++++++++++++++++++++++ 12 files changed, 699 insertions(+), 466 deletions(-)
Brilliant :) Is it only writing XMP tags, or do you also add reading existing tags? Syncing between F-Spot and Photos (Merging or setting (from master (sqlite or XMP)))?
Currently, the only thing it does (related to XMP) is moving the metadata writing out of the main loop, so the behavior is basically unchanged, it just doesn't block the UI anymore. This is more the start of a background task framework (and a start to make f-spot more threadsafe). Tasks scheduled with a workerthread are guaranteed to execute someday (and most of the time that's within a few seconds). Once a task is started, f-spot will complete it (unless it crashes completely, which it simply shouldn't do). The task queue is stored in the database and thus retained when stopping f-spot. Task execution will restart 15 seconds after the next start of f-spot. The logic behind this is: when a user starts f-spot, he wants to use it, give him some time before starting (possibly heavy) tasks. This can also be (trivially) extended to do scheduled tasks (call it f-spot's internal cron). I plan on using this to implement f-spot <-> flickr picture synchronization*, once a picture has been exported to flickr, it's tags and description will be kept in sync with flickr.com. For this, we need a periodical task mechanism, which runs on the background.
Created attachment 64161 [details] [review] f-spot-async-database.patch v2 Slightly updated version, from my bzr branch.
Created attachment 64932 [details] [review] f-spot-async-database.patch v3 Synced with CVS HEAD of 2006-05-06.
Created attachment 65370 [details] [review] f-spot-async-database.patch v4 Slightly updated version, only writes metadata when the image is still in the database (prevents crashes in the workerthread). Exceptions in the workerthread should probably be sent to the user.
Created attachment 65938 [details] [review] f-spot-async-database.patch v5 Updated to HEAD of Sun May 21 14:33:29 CEST 2006. Current diffstat: .bzrignore | 60 ++++++++ src/Core.cs | 9 + src/Db.cs | 356 +++++++++++++++++++++++++++++++++++++++++----------- src/ImportStore.cs | 53 +------ src/MainWindow.cs | 115 +++++++--------- src/Makefile.am | 1 src/MetaStore.cs | 69 ++-------- src/PhotoStore.cs | 256 +++++++++++-------------------------- src/TagCommands.cs | 3 src/TagStore.cs | 72 ++++------ src/Updater.cs | 46 ++---- src/WorkerThread.cs | 204 +++++++++++++++++++++++++++++ 12 files changed, 758 insertions(+), 486 deletions(-) The .bzrignore file is a utilty file from my bzr branch, I'm just too lazy to delete it from my automated diff :-).
Created attachment 66851 [details] [review] f-spot-async-database.patch v6 Updated to CVS HEAD of Tue Jun 6 21:21:08 CEST 2006.
Created attachment 66967 [details] [review] f-spot-async-database.patch v7 New version, fixes small conflict in src/Updater.cs
Quick patch review: pros: - this is the most fabulous patch for f-spot I've ever seen !!! - it apply against CVS and compile cleanly - it speeds up *every* metadata modification: tags, Adjust time - works also when importing with a Tag - support close f-spot and restart, jobs are cleanly stored and restored from the db - it's really a thing that improve a lot the user experience cons: - nope (but did'nt look too long at the code)
I just applied it and tested to apply one tag to all my photos (300 or so) Just select all photos, and drag/drop to a tag. I get the following in the console. Unhandled Exception: Mono.Data.SqliteClient.SqliteBusyException: The database is locked. in <0x0010c> Mono.Data.SqliteClient.SqliteCommand:ExecuteStatement (IntPtr pStmt, System.Int32 cols, System.IntPtr pazValue, System.IntPtr pazColName) in <0x00031> Mono.Data.SqliteClient.SqliteCommand:ExecuteStatement (IntPtr pStmt) in <0x001bd> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32 rows_affected) in <0x0001c> Mono.Data.SqliteClient.SqliteCommand:ExecuteNonQuery () in <0x00072> QueuedSqliteCommand:Execute ()
That really shouldn't happen, but I'm not sure if this is related to the patch (it doesn't do any "locking" itself, it's sqlite that does this). Does this happen every time or only with specific use cases?
sorry for coming with bad news. I did check out a fresh F-Spot. Applied your patch. compiled, and run. I discovered that I had forgotten to erase my existing photos.bb, but everything seemed to work fine (apart from the fact that my existing photos.db was a bit newer than expected. Forgot which patch I had on it last though!:( ) Selected all photos, tagged them, and a bit later I had that problem. After that, F-Spot was hanging, and I could only CTRL-C it. I removed photos.db, and Photos, started F-Spot again, and imported the photos, and did a number of tagging/;de-tagging operations. No deadlocks. Perhaps it was just the combination of that other database? But again, not sure which one I had installed. sorry.
The patch update the db by adding a jobs table. And when you need it, you check if that table exists. Right ? But there is a meta table in the db, containing the db version. Why aren't you incrementing that field? Or database version are only used for released versions of f-spot ?
Two more things about the patch. 1)Multiple jobs I've 1400 picture in f-spot (for test purpose). tagging everything with a first tag, then with a second. Just after that, checked the database to see: sqlite> select count(*) from jobs; 2685 I'm just wondering, before looking at the code: - if the 'command' is the same (WriteMetaData), why adding a new line for the same image ? - if the same command for the same image appears twice in the jobs table, the job is executed twice ? or when you pick a job, you also check for duplicate jobs ? 2)Jobs not deleted Add a bunch of images, tag them, delete them, stop f-spot. There's still jobs in the table. What's the point with this ? Well, f-spot recycle photo_ids, so extend the scenario to 'add, tag, delete, add others' and remaining jobs will apply to the new images. Since the job is WriteMetaData, it's nothing, but if one day you extend that to other jobs... My solution, when you remove picture, remove also associated jobs. The problem is that you use the 'option' field of your 'jobs' table to store photo_id. Why not add a (optional) photo_id field, so when removing picture, remove also all jobs for that picture.
(In reply to comment #15) > I'm just wondering, before looking at the code: > - if the 'command' is the same (WriteMetaData), why adding a new line for the > same image ? > - if the same command for the same image appears twice in the jobs table, the > job is executed twice ? or when you pick a job, you also check for duplicate > jobs ? It handles that just fine! It'll only execute it once. I've chosen to do duplicate submits instead of checking for existing jobs to minimize the blocking time when adding (when performance matters as it blocks the main UI). It's even documented in the code: + /* Removes all similar items, jobs with identical parameters. Rather than testing for + * duplicate jobs while inserting, we delete all duplicates here, as insertions are + * much more urgent (and should happen faster than deletions). + */ + public void RemoveAll (WorkerThreadItem item) Jobs that shouldn't run more than once should call RemoveAll on themselves, which takes care of cleaning up dupes. > 2)Jobs not deleted > Add a bunch of images, tag them, delete them, stop f-spot. > There's still jobs in the table. > What's the point with this ? Well, f-spot recycle photo_ids, As far as I know, it doesn't, here's what's in the database schema: CREATE TABLE photos ( id INTEGER PRIMARY KEY NOT NULL, Which basically means: increment forever. > so extend the > scenario to 'add, tag, delete, add others' and remaining jobs will apply to the > new images. Since the job is WriteMetaData, it's nothing, but if one day you > extend that to other jobs... > My solution, when you remove picture, remove also associated jobs. > The problem is that you use the 'option' field of your 'jobs' table to store > photo_id. Why not add a (optional) photo_id field, so when removing picture, > remove also all jobs for that picture. Spurious jobs also get cleaned up when they are executed. On line 72 in src/WorkerThread.cs: if (p != null) { // Only write metadata on images that still exist in the database. Whether we let the job decide if it's still valid or do a cascaded delete is just a matter of taste. Doing it this way makes it cleaner to extend the system with extra job types on photos though, as we don't have to change anything to the photo classes.
> It handles that just fine! It'll only execute it once. Great, just popped the question to be sure. and it's probably more efficient than checking at insert time > As far as I know, it doesn't, here's what's in the database schema: > CREATE TABLE photos ( id INTEGER PRIMARY KEY NOT NULL, and *not* "id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL" choosing Autoincrement is the only way to ensure that "The id chosen for the new row is one larger than the largest id that has ever before existed in that same table." (from http://www.sqlite.org/autoinc.html) So add picture, they will have greater id than the previous. But if you remove the latest pictures imported (with the latest ids), f-spot *would* re-use those ids. I'm sure of it, I've discovered it when trying #321770. So, F-SPot *did* recycle id > then the p!=null statement could be false and action executed anyway. One more time, it's not a big issue with WriteMetaData, and this patch is still my 'Top-most-wanted'.
I can not reproduce the deadlock, must have been a fluke on my system at that time. But I did use a prestine CVS with your patch. and a modified photos.db though.
Created attachment 67350 [details] [review] f-spot-async-database.patch v8 Updated version, which deletes jobs corresponding to images when an image is deleted. WARNING: this has a new database format, so you should nuke your current jobs table (if any) (see below). I have not written a migration routine as this hasn't even been into cvs. Nuking your jobs table: $ cd ~/.gnome2/f-spot/ $ sqlite photos.db OR (depending on what database you have) $ sqlite3 photos.db -> DROP TABLE jobs; The statistics: .bzrignore | 60 +++++++ src/Core.cs | 10 + src/Db.cs | 359 +++++++++++++++++++++++++++++++++--------- src/ImportStore.cs | 53 +----- src/MainWindow.cs | 115 ++++++------- src/Makefile.am | 1 src/MetaStore.cs | 69 +------- src/PhotoStore.cs | 257 +++++++++--------------------- src/TagCommands.cs | 3 src/TagStore.cs | 72 +++----- src/Updater.cs | 46 +---- src/WorkerThread.cs | 221 +++++++++++++++++++++++++ 12 files changed, 780 insertions(+), 486 deletions(-)
Created attachment 67724 [details] [review] f-spot-async-database.patch v9 Added a one line fix to the patch to fix a stupid SQL query. I'm probably going to rework this patch after my exams, to greatly expand the scope of the workerthread. The effect on the app usability will be even greater then. So I'd advice against merging this one for now (unless there's no new version in three months ;-)). Just making sure the posted version works though.
The threaded database patch has been split of and can now be found in bug 346338. The current workerthread will be revamped to handle more use cases (to reduce the blocking of the UI on virtually any operation). Marking the last patch obsolete for now.
Created attachment 69382 [details] [review] f-spot-jobscheduler.patch Jobscheduler, makes f-spot ninja. .bzrignore | 60 +++ FlickrNet/Makefile.am | 2 configure.in | 4 libgphoto2-sharp/Makefile.am | 2 semweb/Makefile.am | 2 src/Core.cs | 7 src/Db.cs | 358 +++++++++++++++---- src/ImportStore.cs | 53 -- src/JobScheduler.cs | 593 +++++++++++++++++++++++++++++++++ src/MainWindow.cs | 105 ++--- src/Makefile.am | 3 src/MetaStore.cs | 69 --- src/PhotoStore.cs | 311 +++++++---------- src/TagCommands.cs | 3 src/TagStore.cs | 75 +--- src/Updater.cs | 46 -- 16 files changed, 1207 insertions(+), 486 deletions(-) Just to let everybody know what I'm doing, here's the first version of the revamped WorkerThread (now called jobscheduler). It does the basic things (scheduling jobs), but it does not display feedback to the user yet. Feel free to test. It also includes the two patches from the gmcs bug and the threaded database bug (as it needs them). I know abock has raised complaints about the threaded database implementation (and I will fix that in the long run), but that shouldn't affect this code. Enjoy!
Nice job Ruben ! Some comments though... *) I experienced 2 different crashes: - a crash at startup with jobs in the pipe (but f-spot was stopped nicely) - an UI freeze (need to ctrl-C) *) Is it possible to renice the jobs thread ? when a lot of jobs are executed in the pipe, my machine (and f-spot) is damn slow *) There's new requirements at compile time (updated version of Sqlite) *) Now, there's a lot of warning at compile time, probably caused by the switch to gmcs This patch rocks! definitively. I'd like to find some time to read and understand all your code, but it's a big thing !!
(In reply to comment #23) > Nice job Ruben ! > > Some comments though... > *) I experienced 2 different crashes: > - a crash at startup with jobs in the pipe (but f-spot was stopped nicely) > - an UI freeze (need to ctrl-C) Are you aware of a way to reproduce this? Or provide me with a backtrace? Or even just the console output? The patch is configured to be very verbose & very error checking (this can be controlled with the JOBSCHED_DEBUG_ASSERTS, JOBSCHED_DEBUG_MSGS and JOBSCHED_DEBUG_STRICT_BYPASS_CHECK defines in JobScheduler.cs, comment those and the debug code will be left out). > *) Is it possible to renice the jobs thread ? when a lot of jobs are executed > in the pipe, my machine (and f-spot) is damn slow Yes, I'm aware that it's maybe a tad too fast :-) > *) There's new requirements at compile time (updated version of Sqlite) Not that I'm aware of? > *) Now, there's a lot of warning at compile time, probably caused by the switch > to gmcs Yes, the appropriate patch is in bug 346977. There's a lot of unneeded code being detected by gmcs. I've left it in for now. > This patch rocks! definitively. I'd like to find some time to read and > understand all your code, but it's a big thing !! The problem with the patch posted is that it accumulates the patches from bug 346338 and bug 346977. I can provide seperate diffs too (thanks to the wonders of bzr branches), but for easy testing, I posted the combined version.
About the crashes: no, I did'nt kept any trace. But I'll try to reproduce that. About the requirement: it required me to install libmono-sqlite2.0-cil instead of libmono-sqlite1.0-cil (debian machine) And one more thing: when you select a lot of images (tested with 400+) and tag them, there's still a short time (10 secs) where the UI is frozen...
(In reply to comment #25) > About the requirement: it required me to install libmono-sqlite2.0-cil instead > of libmono-sqlite1.0-cil (debian machine) I think that's caused by the switch to gmcs. > And one more thing: when you select a lot of images (tested with 400+) and tag > them, there's still a short time (10 secs) where the UI is frozen... The patch does not background adding tags (as that's a bit more complicated), only the writing of metadata. What would be possible in the (semi) near future is to add another job type called AddTags (or similar), which gets a list of images and a tag. Adding a tag to 400 images will then simply be a matter of creating one job. This job will then add the tag to the images in the background and schedule the desired XMP write jobs (this scheduling / adding is what takes so long). There's a lot of improvements to be gained, I just made the infrastructure to do them.
When I compile F-spot with theis patch, I cannot start it. This is my output: dotancohen@ubuntu:~$ xhost + access control disabled, clients can connect from any host dotancohen@ubuntu:~$ su test Password: sh-3.1$ cd ~/unstable/f-spot/bin/ sh-3.1$ dbus-launch ./f-spot (f-spot:23487): GnomeUI-WARNING **: While connecting to session manager: Could not open network socket. Starting new FSpot server XXXXX Mono.Data.SqliteClient.SqliteSyntaxException: library routine called out of sequence in <0x00106> Mono.Data.SqliteClient.SqliteCommand:GetNextStatement (IntPtr pzStart, System.IntPtr pzTail, System.IntPtr pStmt) in <0x000d0> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32 rows_affected) in <0x0001d> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader (CommandBehavior behavior) in <0x0000c> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader () in <0x00011> Mono.Data.SqliteClient.SqliteCommand:ExecuteScalar () in <0x0005a> QueuedSqliteCommand:Execute () XXXXX Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server Starting new FSpot server And the text "Starting new FSpot server" repeats forever without any GUI appearing.
I've now tried to patch on a fresh CVS, with a brand new test user. This is what I got: user@ubuntu:~/development/f-spot/f-spot$ patch -p0 < thepatch.diff patching file .bzrignore patching file src/JobScheduler.cs patching file FlickrNet/Makefile.am patching file configure.in Hunk #1 FAILED at 16. 1 out of 1 hunk FAILED -- saving rejects to file configure.in.rej patching file libgphoto2-sharp/Makefile.am patching file semweb/Makefile.am Hunk #1 succeeded at 1 with fuzz 1. patching file src/Core.cs patching file src/Db.cs patching file src/ImportStore.cs patching file src/MainWindow.cs Hunk #1 FAILED at 18. Hunk #2 succeeded at 477 (offset 20 lines). Hunk #3 succeeded at 2895 (offset 183 lines). 1 out of 3 hunks FAILED -- saving rejects to file src/MainWindow.cs.rej patching file src/Makefile.am Reversed (or previously applied) patch detected! Assume -R? [n] I stress, that there were no other patches applied.
Created attachment 74181 [details] [review] f-spot-jobscheduler-2.patch Here's my latest bzr branch diff. Should apply to CVS HEAD.
This patch applies cleanly, and works very nice. What is the relationship with the WorkerThread in bug #346338? Restarting F-Spot continues the updating of metadata. Comment #19 indicated that the when a photo is deleted all associated jobs should be deleted as well. I did the following: 1) applied a tag to 700 photos, 2) removed another tag from 700 photos 3) deleted 400 photos F-Spot did not crash, but I got loads of Error syncing metadata to file System.IO.FileNotFoundException: Could not find file "/home/bengt/Photos/2001/5/27/F1020009.JPG" : /home/bengt/Photos/2001/5/27/F1020009.JPG at System.IO.File.GetAttributes (System.String path) [0x00000] at FSpot.JpegFile.SaveMetaData (System.String path) [0x00000] at Photo.WriteMetadataToImage () [0x00000] at WriteMetadataJob.Execute () [0x00000] and ### JobScheduler: Valid stack open uri = file:///home/bengt/Photos/2001/5/26/F1020018.JPG System.IO.FileNotFoundException: Could not find uri "file:///home/bengt/Photos/2001/5/26/F1020018.JPG". at Gnome.Vfs.VfsStream..ctor (System.String text_uri, FileMode mode, Boolean async) [0x00000] at Gnome.Vfs.VfsStream..ctor (System.String uri, FileMode mode) [0x00000] at (wrapper remoting-invoke-with-check) Gnome.Vfs.VfsStream:.ctor (string,System.IO.FileMode) at FSpot.ImageFile.Open () [0x00000] at FSpot.JpegFile.get_Header () [0x00000] at FSpot.JpegFile..ctor (System.Uri uri) [0x00000] open uri = file:///home/bengt/Photos/2001/5/26/F1020018.JPG Error syncing metadata to file System.IO.FileNotFoundException: Could not find uri "file:///home/bengt/Photos/2001/5/26/F1020018.JPG". at Gnome.Vfs.VfsStream..ctor (System.String text_uri, FileMode mode, Boolean async) [0x00000] at Gnome.Vfs.VfsStream..ctor (System.String uri, FileMode mode) [0x00000] at (wrapper remoting-invoke-with-check) Gnome.Vfs.VfsStream:.ctor (string,System.IO.FileMode) at FSpot.ImageFile.Open () [0x00000] at FSpot.JpegFile.get_Header () [0x00000] at FSpot.JpegFile.get_ExifData () [0x00000] at FSpot.JpegFile.SetDescription (System.String value) [0x00000] at Photo.WriteMetadataToImage () [0x00000] at WriteMetadataJob.Execute () [0x00000]
I tried the patch against the current CVS version and whilst it seemed to compile ok it crashes at startup, the error is below. kevin@harmony:~/development/f-spot/cvs/src$ ./f-spot --uninstalled --basedir /tmp --photodir /tmp *** Running uninstalled f-spot *** ** (./f-spot.exe:13640): WARNING **: The following assembly referenced from /home/kevin/development/f-spot/cvs/src/f-spot.exe could not be loaded: Assembly: NDesk.DBus.GLib (assemblyref_index=22) Version: 0.0.0.0 Public Key: (none) The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (/home/kevin/development/f-spot/cvs/src/). ** (./f-spot.exe:13640): WARNING **: Missing method Init in assembly /home/kevin/development/f-spot/cvs/src/f-spot.exe, type NDesk.DBus.BusG ** ERROR **: file mini.c: line 9665 (mono_jit_compile_method_inner): should not be reached aborting... Aborted
Kevin, the patch is not responsible of that. just do a 'make install'...
When patching, I got this output: user@ubuntu:~/development/f-spot/f-spot$ patch -p0 < thepatch.diff patching file src/JobScheduler.cs can't find file to patch at input line 602 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- | |=== modified file '.bzrignore' |--- .bzrignore 2006-09-01 14:37:48 +0000 |+++ .bzrignore 2006-09-03 10:37:26 +0000 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored patching file FlickrNet/Makefile.am patching file configure.in patching file libgphoto2-sharp/Makefile.am patching file semweb/Makefile.am patching file src/Core.cs Hunk #1 succeeded at 21 with fuzz 2 (offset -3 lines). Hunk #2 succeeded at 105 with fuzz 1 (offset -36 lines). Hunk #3 succeeded at 228 with fuzz 2 (offset -36 lines). Hunk #4 succeeded at 246 (offset -36 lines). patching file src/Db.cs patching file src/ImportStore.cs patching file src/MainWindow.cs patching file src/Makefile.am Hunk #1 succeeded at 59 (offset 5 lines). patching file src/MetaStore.cs patching file src/PhotoStore.cs patching file src/TagCommands.cs patching file src/TagStore.cs patching file src/Updater.cs user@ubuntu:~/development/f-spot/f-spot$ user@ubuntu:~/unstable/f-spot/bin$ ./f-spot XXXXX Mono.Data.SqliteClient.SqliteSyntaxException: library routine called out of sequence in <0x00106> Mono.Data.SqliteClient.SqliteCommand:GetNextStatement (IntPtr pzStart, System.IntPtr pzTail, System.IntPtr pStmt) in <0x000d0> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32 rows_affected) in <0x0001d> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader (CommandBehavior behavior) in <0x0000c> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader () in <0x00011> Mono.Data.SqliteClient.SqliteCommand:ExecuteScalar () in <0x0005a> QueuedSqliteCommand:Execute () XXXXX -- HUNG FOR 5 MINUTES, KILLED IT WITH CTRL-C -- user@ubuntu:~/unstable/f-spot/bin$ ./f-spot XXXXX System.Exception: Unsupported database version in <0x0031f> Db:Init (System.String path, Boolean create_if_missing) in <0x00086> FSpot.Core:.ctor () in <0x004e2> FSpot.Driver:Main (System.String[] args) XXXXX -- HUNG FOR 5 MINUTES, KILLED IT WITH CTRL-C --
(In reply to comment #33) > user@ubuntu:~/unstable/f-spot/bin$ ./f-spot > XXXXX > Mono.Data.SqliteClient.SqliteSyntaxException: library routine called out of > sequence > in <0x00106> Mono.Data.SqliteClient.SqliteCommand:GetNextStatement (IntPtr > pzStart, System.IntPtr pzTail, System.IntPtr pStmt) > in <0x000d0> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader > (CommandBehavior behavior, Boolean want_results, System.Int32 rows_affected) > in <0x0001d> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader > (CommandBehavior behavior) > in <0x0000c> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader () > in <0x00011> Mono.Data.SqliteClient.SqliteCommand:ExecuteScalar () > in <0x0005a> QueuedSqliteCommand:Execute () Do you have the output of what happend before the XXXXX? Part of the new database layer is about avoiding that. It shouldn't even be possible to trigger that (the code is used in banshee too, so it can be considered stable), so I'd like to know what was happening then. Also, does f-spot even like to be executed like that? (uninstalled, without special parameters) That might be the cause of this.
As long as you do the following it is ok 1) download a fresh f-spot copy from cvs 2) autogen --prefix=/home/<user>/unstable/f-spot 3) make 4) make install this to verify cvs is ok 5) patch -p0 < <patch.diff.file> 6) autogen --prefix=/home/<user>/unstable/f-spot 7) make 8) make install 9) cd ~/unstable/f-spot/bin 10) ./f-spot --basedir /tmp --photodir /tmp (or whereever you want to have your database and test photos) Do observe that this patch modifes the tables, so ensure you do not test it on your live data, also best to test the patch on a new database just to be sure. Was this what you did, or?
Ruben: > Do you have the output of what happend before the XXXXX? What you saw was all the output that I have. Everything else on the console was from the install, which went smoothly except for the patch. The output of the patch I mentioned in my previous comment (comment #33). > Also, does f-spot even like to be executed like that? (uninstalled, > without special parameters) That might be the cause of this. No, this is how I build each time I test a patch. Bengt: Unpatched CVS F-Spot installs and runs fine. I removed photos.db, ~/unstable, and ~/development before building, of course. Therefore, I do not specify the basedir and photodir. Rather, I import a folder of test images as soon as I fire up F-SPot.
I have followed Bengt's Instructions above and have got past the problem I had earlier however now when I run f-spot I get BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp repeated continually on the console, the command I used was kevin@harmony:~/unstable/f-spot/bin$ ./f-spot --basedir /tmp --photodir /tmp So I backed up my photos.db and removed it and tried without the overrides. kevin@harmony:~/unstable/f-spot/bin$ ./f-spot XXXXX Mono.Data.SqliteClient.SqliteSyntaxException: library routine called out of sequence in <0x00181> Mono.Data.SqliteClient.SqliteCommand:GetNextStatement (IntPtr pzStart, System.IntPtr pzTail, System.IntPtr pStmt) in <0x00136> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32 rows_affected) in <0x0002b> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader (CommandBehavior behavior) in <0x00013> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader () in <0x00022> Mono.Data.SqliteClient.SqliteCommand:ExecuteScalar () in <0x00080> QueuedSqliteCommand:Execute () XXXXX which caused the above output, and f-spot to sit at around 50-60% CPU usage. I ctrl-c'd this and tried again, giving the following; kevin@harmony:~/unstable/f-spot/bin$ ./f-spot XXXXX System.Exception: Unsupported database version in <0x003c2> Db:Init (System.String path, Boolean create_if_missing) in <0x000bb> FSpot.Core:.ctor () in <0x00697> FSpot.Driver:Main (System.String[] args) XXXXX Again no program window and ~60% CPU.
In the command: kevin@harmony:~/unstable/f-spot/bin$ ./f-spot --basedir /tmp --photodir /tmp You specifically say that you want those directories in /tmp. Change those values to wherever you'd like them.
I got the same results that I got in Comment #33. As for the request to the earlier output, here it is (well, as far back as Konsole goes): U f-spot/FlickrNet/Makefile.am U f-spot/FlickrNet/OnlineUsers.cs U f-spot/FlickrNet/Person.cs U f-spot/FlickrNet/PhotoCounts.cs U f-spot/FlickrNet/PhotoInfo.cs U f-spot/FlickrNet/PhotoSearchOptions.cs U f-spot/FlickrNet/PhotoSets.cs U f-spot/FlickrNet/Photos.cs U f-spot/FlickrNet/Response.cs U f-spot/FlickrNet/Sizes.cs U f-spot/FlickrNet/TestAuthFlickr.cs U f-spot/FlickrNet/UploadProgressEvent.cs U f-spot/FlickrNet/Uploader.cs U f-spot/FlickrNet/User.cs U f-spot/FlickrNet/Utils.cs cvs server: Updating f-spot/dbus-sharp U f-spot/dbus-sharp/.cvsignore U f-spot/dbus-sharp/Address.cs U f-spot/dbus-sharp/AssemblyInfo.cs U f-spot/dbus-sharp/Authentication.cs U f-spot/dbus-sharp/Bus.cs U f-spot/dbus-sharp/BusObject.cs U f-spot/dbus-sharp/COPYING U f-spot/dbus-sharp/Connection.cs U f-spot/dbus-sharp/DBus.cs U f-spot/dbus-sharp/DProxy.cs U f-spot/dbus-sharp/ExportObject.cs U f-spot/dbus-sharp/Introspection.cs U f-spot/dbus-sharp/IntrospectionSchema.cs U f-spot/dbus-sharp/Makefile.am U f-spot/dbus-sharp/Mapper.cs U f-spot/dbus-sharp/Message.cs U f-spot/dbus-sharp/MessageFilter.cs U f-spot/dbus-sharp/MessageReader.cs U f-spot/dbus-sharp/MessageWriter.cs U f-spot/dbus-sharp/Protocol.cs U f-spot/dbus-sharp/README U f-spot/dbus-sharp/Server.cs U f-spot/dbus-sharp/Signature.cs U f-spot/dbus-sharp/Transport.cs U f-spot/dbus-sharp/UnixMonoTransport.cs U f-spot/dbus-sharp/UnixNativeTransport.cs U f-spot/dbus-sharp/Wrapper.cs cvs server: Updating f-spot/dbus-sharp-glib U f-spot/dbus-sharp-glib/.cvsignore U f-spot/dbus-sharp-glib/AssemblyInfo.cs U f-spot/dbus-sharp-glib/COPYING U f-spot/dbus-sharp-glib/GLib.IO.cs U f-spot/dbus-sharp-glib/GLib.cs U f-spot/dbus-sharp-glib/Makefile.am U f-spot/dbus-sharp-glib/NDesk.DBus.GLib.dll.config U f-spot/dbus-sharp-glib/README cvs server: Updating f-spot/docs U f-spot/docs/Makefile.am cvs server: Updating f-spot/docs/en U f-spot/docs/en/Makefile.am U f-spot/docs/en/index.xml cvs server: Updating f-spot/gnome-keyring-sharp U f-spot/gnome-keyring-sharp/.cvsignore U f-spot/gnome-keyring-sharp/AccessRights.cs U f-spot/gnome-keyring-sharp/AssemblyInfo.cs U f-spot/gnome-keyring-sharp/AttributeType.cs U f-spot/gnome-keyring-sharp/GenericItemData.cs U f-spot/gnome-keyring-sharp/ItemACL.cs U f-spot/gnome-keyring-sharp/ItemData.cs U f-spot/gnome-keyring-sharp/ItemType.cs U f-spot/gnome-keyring-sharp/KeyringException.cs U f-spot/gnome-keyring-sharp/KeyringInfo.cs U f-spot/gnome-keyring-sharp/Makefile.am U f-spot/gnome-keyring-sharp/NetItemData.cs U f-spot/gnome-keyring-sharp/NoteItemData.cs U f-spot/gnome-keyring-sharp/Operation.cs U f-spot/gnome-keyring-sharp/RequestMessage.cs U f-spot/gnome-keyring-sharp/ResponseMessage.cs U f-spot/gnome-keyring-sharp/ResultCode.cs U f-spot/gnome-keyring-sharp/Ring.cs cvs server: Updating f-spot/google-sharp U f-spot/google-sharp/.cvsignore U f-spot/google-sharp/AlbumAccess.cs U f-spot/google-sharp/AssemblyInfo.cs U f-spot/google-sharp/Authentication.cs U f-spot/google-sharp/CaptchaException.cs U f-spot/google-sharp/CreateAlbumException.cs U f-spot/google-sharp/DeleteAlbumException.cs U f-spot/google-sharp/GoogleConnection.cs U f-spot/google-sharp/GoogleService.cs U f-spot/google-sharp/Makefile.am U f-spot/google-sharp/MultipartRequest.cs U f-spot/google-sharp/NoCheckCertificatePolicy.cs U f-spot/google-sharp/PicasaAlbum.cs U f-spot/google-sharp/PicasaAlbumCollection.cs U f-spot/google-sharp/PicasaPicture.cs U f-spot/google-sharp/PicasaPictureCollection.cs U f-spot/google-sharp/PicasaV1.cs U f-spot/google-sharp/PicasaWeb.cs U f-spot/google-sharp/UploadPictureException.cs U f-spot/google-sharp/UploadProgressEventArgs.cs U f-spot/google-sharp/UploadProgressEventHandler.cs U f-spot/google-sharp/XmlUtil.cs cvs server: Updating f-spot/icons U f-spot/icons/.cvsignore U f-spot/icons/Makefile.am U f-spot/icons/f-spot-adjust-colors.png U f-spot/icons/f-spot-browse.png U f-spot/icons/f-spot-camera.png U f-spot/icons/f-spot-crop.png U f-spot/icons/f-spot-desaturate.png U f-spot/icons/f-spot-edit-image.png U f-spot/icons/f-spot-events.png U f-spot/icons/f-spot-favorite.png U f-spot/icons/f-spot-fullscreen.png U f-spot/icons/f-spot-hidden.png U f-spot/icons/f-spot-imported-xmp-tags.png U f-spot/icons/f-spot-loading.png U f-spot/icons/f-spot-logo.png U f-spot/icons/f-spot-new-tag.png U f-spot/icons/f-spot-not.png U f-spot/icons/f-spot-other.png U f-spot/icons/f-spot-people.png U f-spot/icons/f-spot-places.png U f-spot/icons/f-spot-question-mark.png U f-spot/icons/f-spot-red-eye.png U f-spot/icons/f-spot-rotate-270.png U f-spot/icons/f-spot-rotate-90.png U f-spot/icons/f-spot-sepia.png U f-spot/icons/f-spot-simple-white.css U f-spot/icons/f-spot-simple.css U f-spot/icons/f-spot-slideshow.png U f-spot/icons/f-spot-stock_far.png U f-spot/icons/f-spot-stock_near.png U f-spot/icons/f-spot.js cvs server: Updating f-spot/libeog U f-spot/libeog/.cvsignore U f-spot/libeog/Makefile.am U f-spot/libeog/access.c U f-spot/libeog/access.h U f-spot/libeog/accessible-image-view-factory.c U f-spot/libeog/accessible-image-view-factory.h U f-spot/libeog/accessible-image-view.c U f-spot/libeog/accessible-image-view.h U f-spot/libeog/cursors.c U f-spot/libeog/cursors.h U f-spot/libeog/eog-file-selection.c U f-spot/libeog/eog-file-selection.h U f-spot/libeog/eog-image.c U f-spot/libeog/eog-image.h U f-spot/libeog/eog-pixbuf-util.c U f-spot/libeog/eog-pixbuf-util.h U f-spot/libeog/eog-scroll-view.c U f-spot/libeog/eog-scroll-view.h U f-spot/libeog/image-view.c U f-spot/libeog/image-view.h U f-spot/libeog/libeog-marshal.list U f-spot/libeog/ui-image.c U f-spot/libeog/ui-image.h U f-spot/libeog/uta.c U f-spot/libeog/uta.h U f-spot/libeog/zoom.c U f-spot/libeog/zoom.h cvs server: Updating f-spot/libeog/cursors U f-spot/libeog/cursors/.cvsignore U f-spot/libeog/cursors/Makefile.am U f-spot/libeog/cursors/hand-closed-data.xbm U f-spot/libeog/cursors/hand-closed-mask.xbm U f-spot/libeog/cursors/hand-open-data.xbm U f-spot/libeog/cursors/hand-open-mask.xbm cvs server: Updating f-spot/libfspot U f-spot/libfspot/.cvsignore U f-spot/libfspot/Makefile.am U f-spot/libfspot/f-image-view.c U f-spot/libfspot/f-image-view.h U f-spot/libfspot/f-jpeg-utils.c U f-spot/libfspot/f-jpeg-utils.h U f-spot/libfspot/f-marshal.list U f-spot/libfspot/f-pixbuf-save.c U f-spot/libfspot/f-pixbuf-unsharp.c U f-spot/libfspot/f-pixbuf-utils.c U f-spot/libfspot/f-pixbuf-utils.h U f-spot/libfspot/f-screen-utils.c U f-spot/libfspot/f-utils.c U f-spot/libfspot/f-utils.h cvs server: Updating f-spot/libgphoto2-sharp U f-spot/libgphoto2-sharp/.cvsignore U f-spot/libgphoto2-sharp/AssemblyInfo.cs U f-spot/libgphoto2-sharp/Camera.cs U f-spot/libgphoto2-sharp/CameraAbilitiesList.cs U f-spot/libgphoto2-sharp/CameraFile.cs U f-spot/libgphoto2-sharp/CameraFilesystem.cs U f-spot/libgphoto2-sharp/CameraList.cs U f-spot/libgphoto2-sharp/CameraWidget.cs U f-spot/libgphoto2-sharp/Context.cs U f-spot/libgphoto2-sharp/ErrorCodes.cs U f-spot/libgphoto2-sharp/Makefile.am U f-spot/libgphoto2-sharp/Object.cs U f-spot/libgphoto2-sharp/Port.cs U f-spot/libgphoto2-sharp/PortInfo.cs U f-spot/libgphoto2-sharp/PortInfoList.cs U f-spot/libgphoto2-sharp/libgphoto2-sharp.dll.config cvs server: Updating f-spot/libjpegtran U f-spot/libjpegtran/.cvsignore U f-spot/libjpegtran/Makefile.am U f-spot/libjpegtran/README U f-spot/libjpegtran/jpeg-data.c U f-spot/libjpegtran/jpeg-data.h U f-spot/libjpegtran/jpeg-marker.c U f-spot/libjpegtran/jpeg-marker.h U f-spot/libjpegtran/jpegtran.c U f-spot/libjpegtran/jpegtran.h U f-spot/libjpegtran/transupp.c U f-spot/libjpegtran/transupp.h cvs server: Updating f-spot/m4 cvs server: Updating f-spot/po U f-spot/po/.cvsignore U f-spot/po/ChangeLog U f-spot/po/POTFILES.in U f-spot/po/POTFILES.skip U f-spot/po/bg.po U f-spot/po/ca.po U f-spot/po/cs.po U f-spot/po/da.po U f-spot/po/de.po U f-spot/po/el.po U f-spot/po/en_CA.po U f-spot/po/en_GB.po U f-spot/po/es.po U f-spot/po/et.po U f-spot/po/eu.po U f-spot/po/fa.po U f-spot/po/fi.po U f-spot/po/fr.po U f-spot/po/gl.po U f-spot/po/hi.po U f-spot/po/hu.po U f-spot/po/it.po U f-spot/po/ja.po U f-spot/po/lt.po U f-spot/po/mk.po U f-spot/po/nb.po U f-spot/po/nl.po U f-spot/po/pa.po U f-spot/po/pl.po U f-spot/po/pt_BR.po U f-spot/po/ru.po U f-spot/po/rw.po U f-spot/po/sr.po U f-spot/po/sr@Latn.po U f-spot/po/sv.po U f-spot/po/th.po U f-spot/po/vi.po U f-spot/po/zh_CN.po U f-spot/po/zh_HK.po U f-spot/po/zh_TW.po cvs server: Updating f-spot/semweb U f-spot/semweb/.cvsignore U f-spot/semweb/Algos.cs U f-spot/semweb/AssemblyInfo.cs U f-spot/semweb/ForwardLogic.cs U f-spot/semweb/Inference.cs U f-spot/semweb/KnowledgeModel.cs U f-spot/semweb/LiteralFilters.cs U f-spot/semweb/Makefile.am U f-spot/semweb/MemoryStore.cs U f-spot/semweb/N3Parser.cs U f-spot/semweb/N3Reader.cs U f-spot/semweb/N3Writer.cs U f-spot/semweb/NamespaceManager.cs U f-spot/semweb/Query.cs U f-spot/semweb/RDFS.cs U f-spot/semweb/README U f-spot/semweb/RSquary.cs U f-spot/semweb/RSquaryFilters.cs U f-spot/semweb/RdfParser.cs U f-spot/semweb/RdfReader.cs U f-spot/semweb/RdfWriter.cs U f-spot/semweb/RdfXmlReader.cs U f-spot/semweb/RdfXmlWriter.cs U f-spot/semweb/Remote.cs U f-spot/semweb/Resource.cs U f-spot/semweb/SQLStore.cs U f-spot/semweb/Sparql.cs U f-spot/semweb/Statement.cs U f-spot/semweb/Store.cs U f-spot/semweb/UriMap.cs U f-spot/semweb/Util.cs U f-spot/semweb/XPathSemWebNavigator.cs cvs server: Updating f-spot/src U f-spot/src/.cvsignore U f-spot/src/Accelerometer.cs U f-spot/src/AssemblyInfo.cs.in U f-spot/src/AsyncPixbufLoader.cs U f-spot/src/Bim.cs U f-spot/src/BitConverter.cs U f-spot/src/CDExport.cs U f-spot/src/CameraFileSelectionDialog.cs U f-spot/src/CameraSelectionDialog.cs U f-spot/src/Ciff.cs U f-spot/src/Cms.cs U f-spot/src/ColorDialog.cs U f-spot/src/CompatFileChooser.cs U f-spot/src/Core.cs U f-spot/src/DCRawFile.cs U f-spot/src/DateCommands.cs U f-spot/src/Db.cs U f-spot/src/Defines.cs.in U f-spot/src/Delay.cs U f-spot/src/DirectoryAdaptor.cs U f-spot/src/DirectoryCollection.cs U f-spot/src/ExceptionDialog.cs U f-spot/src/Exif.cs U f-spot/src/FileImportBackend.cs U f-spot/src/FindBar.cs U f-spot/src/FlickrExport.cs U f-spot/src/FlickrRemote.cs U f-spot/src/FolderExport.cs U f-spot/src/FormClient.cs U f-spot/src/FotkiRemote.cs U f-spot/src/FullScreenView.cs U f-spot/src/GPhotoCamera.cs U f-spot/src/GalleryExport.cs U f-spot/src/GalleryRemote.cs U f-spot/src/GladeDialog.cs U f-spot/src/Global.cs U f-spot/src/GroupAdaptor.cs U f-spot/src/GroupSelector.cs U f-spot/src/HigMessageDialog.cs U f-spot/src/Histogram.cs U f-spot/src/IBrowsableItem.cs U f-spot/src/IOChannel.cs U f-spot/src/IconView.cs U f-spot/src/ImageFile.cs U f-spot/src/ImageView.cs U f-spot/src/ImportBackend.cs U f-spot/src/ImportCommand.cs U f-spot/src/ImportStore.cs U f-spot/src/InfoBox.cs U f-spot/src/InfoDisplay.cs U f-spot/src/InternalProcess.cs U f-spot/src/IptcFile.cs U f-spot/src/IthmbDb.cs U f-spot/src/JpegFile.cs U f-spot/src/JpegHeader.cs U f-spot/src/JpegUtils.cs U f-spot/src/Loupe.cs U f-spot/src/MailDialog.cs U f-spot/src/MainWindow.cs U f-spot/src/Makefile.am U f-spot/src/MetaStore.cs U f-spot/src/MetadataStore.cs U f-spot/src/MrwFile.cs U f-spot/src/OpenWithMenu.cs U f-spot/src/Operation.cs U f-spot/src/PhotoArray.cs U f-spot/src/PhotoDatabase.cs U f-spot/src/PhotoGrid.cs U f-spot/src/PhotoImageView.cs U f-spot/src/PhotoLoader.cs U f-spot/src/PhotoPopup.cs U f-spot/src/PhotoQuery.cs U f-spot/src/PhotoStore.cs U f-spot/src/PhotoTagMenu.cs U f-spot/src/PhotoVersionCommands.cs U f-spot/src/PhotoVersionMenu.cs U f-spot/src/PhotoView.cs U f-spot/src/PicasaWebExport.cs U f-spot/src/PixbufCache.cs U f-spot/src/PixbufLoader.cs U f-spot/src/PixbufUtils.cs U f-spot/src/PixelBuffer.cs U f-spot/src/PngFile.cs U f-spot/src/PnmFile.cs U f-spot/src/PreferenceDialog.cs U f-spot/src/Preferences.cs U f-spot/src/PreviewPopup.cs U f-spot/src/PrintDialog.cs U f-spot/src/ProgressDialog.cs U f-spot/src/QueryDisplay.cs U f-spot/src/QueryView.cs U f-spot/src/QueryWidget.cs U f-spot/src/RafFile.cs U f-spot/src/RotateCommand.cs U f-spot/src/ScalingIconView.cs U f-spot/src/Scanning.cs U f-spot/src/SendEmail.cs U f-spot/src/SimpleCalendar.cs U f-spot/src/SingleView.cs U f-spot/src/SlideView.cs U f-spot/src/StockIcons.cs U f-spot/src/SvgFile.cs U f-spot/src/TagCommands.cs U f-spot/src/TagMenu.cs U f-spot/src/TagPopup.cs U f-spot/src/TagQueryWidget.cs U f-spot/src/TagSelectionDialog.cs U f-spot/src/TagSelectionWidget.cs U f-spot/src/TagStore.cs U f-spot/src/TagView.cs U f-spot/src/ThreadProgressDialog.cs U f-spot/src/ThumbnailCache.cs U f-spot/src/ThumbnailCommand.cs U f-spot/src/ThumbnailGenerator.cs U f-spot/src/Tiff.cs U f-spot/src/TiffHeader.cs U f-spot/src/TimeAdaptor.cs U f-spot/src/TimeDialog.cs U f-spot/src/TipWindow.cs U f-spot/src/Unix.cs U f-spot/src/Updater.cs U f-spot/src/Util.cs U f-spot/src/Vector.cs U f-spot/src/X3fFile.cs U f-spot/src/XmpFile.cs U f-spot/src/XmpTagsImporter.cs U f-spot/src/ZoomUtils.cs U f-spot/src/dces.rdf U f-spot/src/f-spot.exe.config.in U f-spot/src/f-spot.glade U f-spot/src/f-spot.in U f-spot/src/main.cs cvs server: Updating f-spot/src/Cairo U f-spot/src/Cairo/Cairo.cs U f-spot/src/Cairo/FontOptions.cs U f-spot/src/Cairo/Graphics.cs U f-spot/src/Cairo/Matrix.cs U f-spot/src/Cairo/Pattern.cs U f-spot/src/Cairo/Surface.cs cvs server: Updating f-spot/src/Filters U f-spot/src/Filters/FilterSet.cs U f-spot/src/Filters/IFilter.cs U f-spot/src/Filters/JpegFilter.cs U f-spot/src/Filters/OrientationFilter.cs U f-spot/src/Filters/ResizeFilter.cs cvs server: Updating f-spot/src/Mail U f-spot/src/Mail/Base64AttachmentEncoder.cs U f-spot/src/Mail/EsmtpClient.cs U f-spot/src/Mail/EsmtpMail.cs U f-spot/src/Mail/EsmtpStream.cs U f-spot/src/Mail/IAttachmentEncoder.cs U f-spot/src/Mail/MailAddress.cs U f-spot/src/Mail/MailAddressCollection.cs U f-spot/src/Mail/MailHeader.cs U f-spot/src/Mail/MailMessage.cs U f-spot/src/Mail/MailMessageWrapper.cs U f-spot/src/Mail/MailUtil.cs U f-spot/src/Mail/MimeTypes.cs U f-spot/src/Mail/SmtpException.cs U f-spot/src/Mail/SmtpResponse.cs U f-spot/src/Mail/ToUUEncodingTransform.cs U f-spot/src/Mail/UUAttachmentEncoder.cs cvs server: Updating f-spot/src/Widgets U f-spot/src/Widgets/CairoUtils.cs U f-spot/src/Widgets/CompositeUtils.cs U f-spot/src/Widgets/GdkUtils.cs U f-spot/src/Widgets/ImageDisplay.cs U f-spot/src/Widgets/Overlay.cs U f-spot/src/Widgets/ScrolledView.cs cvs server: Updating f-spot/src/gnomevfs cvs server: Updating f-spot/tools U f-spot/tools/.cvsignore U f-spot/tools/Makefile.am U f-spot/tools/f-spot-import U f-spot/tools/f-spot-screensaver U f-spot/tools/f-spot-screensaver.desktop.in user@ubuntu:~/development/f-spot/f-spot$ vi thepatch.diff user@ubuntu:~/development/f-spot/f-spot$ patch -p0 < thepatch.diff patching file src/JobScheduler.cs can't find file to patch at input line 602 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- | |=== modified file '.bzrignore' |--- .bzrignore 2006-09-01 14:37:48 +0000 |+++ .bzrignore 2006-09-03 10:37:26 +0000 -------------------------- File to patch: Skip this patch? [y] y Skipping patch. 1 out of 1 hunk ignored patching file FlickrNet/Makefile.am patching file configure.in patching file libgphoto2-sharp/Makefile.am patching file semweb/Makefile.am patching file src/Core.cs Hunk #1 succeeded at 21 with fuzz 2 (offset -3 lines). Hunk #2 succeeded at 105 with fuzz 1 (offset -36 lines). Hunk #3 succeeded at 228 with fuzz 2 (offset -36 lines). Hunk #4 succeeded at 246 (offset -36 lines). patching file src/Db.cs patching file src/ImportStore.cs patching file src/MainWindow.cs Hunk #2 succeeded at 2904 (offset 9 lines). patching file src/Makefile.am Hunk #1 succeeded at 59 (offset 5 lines). patching file src/MetaStore.cs patching file src/PhotoStore.cs Hunk #19 succeeded at 1347 (offset -7 lines). patching file src/TagCommands.cs patching file src/TagStore.cs patching file src/Updater.cs user@ubuntu:~/development/f-spot/f-spot$ Before that I cloeaned everything up and downlaoded a brand new CVS: user@ubuntu:~$ su Password: root@ubuntu:/home/user# rm -R /home/user/development/ ; rm -R /home/user/unstable/ ; rm -R /home/user/.gnome2/f-spot/photos.db root@ubuntu:/home/user# exit exit user@ubuntu:~$ CVSROOT=":pserver:anonymous@anoncvs.gnome.org:/cvs/gnome"; export CVSROOT; mkdir -p ~/development/f-spot; mkdir -p ~/unstable/f-spot; cd ~/development/f-spot; cvs checkout f-spot; cd f-spot
I'd just like to add: to confirm that the patch is responsible for F-Spot hanging, I just built and installed F-Spot from CVS without the patch and it installed and started fine.
If you ensure you have a new database (--basedir) any difference?
Bengt, I rm'ed the database in my test user before installing with the patch. And it does appear that F-Spot recreated the database: dotancohen@ubuntu:~$ su Password: root@ubuntu:/home/dotancohen# cd /home/test/.gnome2/f-spot/ root@ubuntu:/home/test/.gnome2/f-spot# ls photos.db
I have just tried the patch again against a fresh CVS copy and I am still getting problems. Using the command kevin@harmony:~/unstable/f-spot/bin$ ./f-spot --basedir /tmp --photodir /tmp I get the message BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp BaseDirectory is now /tmp PhotoDirectory is now /tmp Repeated indefinately unlike the usual 2 lines. Incase it was /tmp I also tried a directory in my home folder but it did the same. BaseDirectory is now /home/kevin/f-spot-test PhotoDirectory is now /home/kevin/f-spot-test/ BaseDirectory is now /home/kevin/f-spot-test PhotoDirectory is now /home/kevin/f-spot-test/ BaseDirectory is now /home/kevin/f-spot-test If I just run the patched version on the default database I still get, kevin@harmony:~/unstable/f-spot/bin$ ./f-spot XXXXX Mono.Data.SqliteClient.SqliteSyntaxException: library routine called out of sequence in <0x00181> Mono.Data.SqliteClient.SqliteCommand:GetNextStatement (IntPtr pzStart, System.IntPtr pzTail, System.IntPtr pStmt) in <0x00136> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32 rows_affected) in <0x0002b> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader (CommandBehavior behavior) in <0x00013> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader () in <0x00022> Mono.Data.SqliteClient.SqliteCommand:ExecuteScalar () in <0x00080> QueuedSqliteCommand:Execute () XXXXX and the same if I delete the database before running and let it try and recreate (It only creates a 0 byte file). The output of the patching was, kevin@harmony:~/development/f-spot/cvs$ patch -p0 < jobscheduler.patch patching file src/JobScheduler.cs can't find file to patch at input line 602 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- | |=== modified file '.bzrignore' |--- .bzrignore 2006-09-01 14:37:48 +0000 |+++ .bzrignore 2006-09-03 10:37:26 +0000 -------------------------- File to patch: Skip this patch? [y] y Skipping patch. 1 out of 1 hunk ignored patching file FlickrNet/Makefile.am patching file configure.in patching file libgphoto2-sharp/Makefile.am patching file semweb/Makefile.am patching file src/Core.cs Hunk #1 succeeded at 21 with fuzz 2 (offset -3 lines). Hunk #2 succeeded at 105 with fuzz 1 (offset -36 lines). Hunk #3 succeeded at 228 with fuzz 2 (offset -36 lines). Hunk #4 succeeded at 246 (offset -36 lines). patching file src/Db.cs patching file src/ImportStore.cs patching file src/MainWindow.cs Hunk #2 succeeded at 2904 (offset 9 lines). patching file src/Makefile.am Hunk #1 succeeded at 59 (offset 5 lines). patching file src/MetaStore.cs patching file src/PhotoStore.cs Hunk #19 succeeded at 1347 (offset -7 lines). patching file src/TagCommands.cs patching file src/TagStore.cs patching file src/Updater.cs Let me know if there is anything else you would like me to try.
I just tried with the latest cvs first I did the following: cd cvs cvs update -dP ./autogen.sh --prefix=/home/bengt/unstable/f-spot/ make make install cd .. Then the following (from my history) 555 cp -R cvs f-spot.337724-JobScheduler 556 cd f-spot.337724-JobScheduler/ 557 patch -p0 < /home/bengt/Desktop/jobscheduler.patch 558 ./autogen.sh --prefix=/home/bengt/unstable/f-spot/ 559 make 560 cd src 561 ./f-spot --uninstalled --basedir /tmp --photodir /tmp And it worked fine...
Something looks broken in the shutdown code. I'd like to check it out, but I'm currently struggling with a hairy project deadline for next friday, so I won't be able to do so till then. Probably some object that keeps waiting, causing the thread to stay alive. Result: f-spot locks up when closing.
Hi Bengt, I am afraid I just tried again and I still get the repeating lines on the console. I tried to match your instructions, including renaming CVS. The only differences were I used a fresh CVS checkout not update and /home/kevin as directory root.
I've made a few tests, and manily I experienced the problems already reported here (#30 and #45). Only once it happened that F-spot locked up on startup. But it didn't happen again, so I can't reproduce. I just know there were some jobs in queue. And once it happened to me that F-spot crashed because of database lock. It happened only once, and while I was running a query on the db (count on jobs). Unluckily I didn't wrote the error, so I don't know where the lock happened and if was caused by the scheduler or not. So maybe it would be better to check those errors. I will try to reproduce if I can. Very nice job!!
for me: works fine, looks great. It takes a looong time to read the whole code, but it's a nice piece of work !
I just trie again, in the hopes that the patch would apply to the latest CVS. No good: user@ubuntu:~/development/f-spot/f-spot$ patch -p0 < tp.diff patching file src/JobScheduler.cs can't find file to patch at input line 602 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- | |=== modified file '.bzrignore' |--- .bzrignore 2006-09-01 14:37:48 +0000 |+++ .bzrignore 2006-09-03 10:37:26 +0000 -------------------------- File to patch: user@ubuntu:~/development/f-spot/f-spot$ Note that this patch has _never_ applied for me. These are the steps I use: $ sudo rm -Rf unstable/ development/ .gnome2/f-spot/photos.db $ CVSROOT=":pserver:anonymous@anoncvs.gnome.org:/cvs/gnome"; export CVSROOT; mkdir -p ~/development/f-spot; mkdir -p ~/unstable/f-spot; cd ~/development/f-spot; cvs checkout f-spot; cd f-spot $ vi tp.diff $ patch -p0 < tp.diff
you can skip (ignore) the bzignore file. go on and patch the other files.
Alright, then, this was my patch output: user@ubuntu:~/development/f-spot/f-spot$ patch -p0 < tp.diff The next patch would create the file src/JobScheduler.cs, which already exists! Assume -R? [n] Apply anyway? [n] Skipping patch. 1 out of 1 hunk ignored -- saving rejects to file src/JobScheduler.cs.rej can't find file to patch at input line 602 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- | |=== modified file '.bzrignore' |--- .bzrignore 2006-09-01 14:37:48 +0000 |+++ .bzrignore 2006-09-03 10:37:26 +0000 -------------------------- File to patch: Skip this patch? [y] y Skipping patch. 1 out of 1 hunk ignored patching file FlickrNet/Makefile.am patching file configure.in patching file libgphoto2-sharp/Makefile.am patching file semweb/Makefile.am patching file src/Core.cs Hunk #1 succeeded at 21 with fuzz 2 (offset -3 lines). Hunk #2 succeeded at 105 with fuzz 1 (offset -36 lines). Hunk #3 succeeded at 228 with fuzz 2 (offset -36 lines). Hunk #4 succeeded at 246 (offset -36 lines). patching file src/Db.cs patching file src/ImportStore.cs patching file src/MainWindow.cs Hunk #1 succeeded at 478 (offset 1 line). Hunk #2 succeeded at 2911 (offset 16 lines). patching file src/Makefile.am Hunk #1 succeeded at 59 (offset 5 lines). patching file src/MetaStore.cs patching file src/PhotoStore.cs Hunk #19 succeeded at 1347 (offset -7 lines). patching file src/TagCommands.cs patching file src/TagStore.cs patching file src/Updater.cs user@ubuntu:~/development/f-spot/f-spot$ ./autogen, make, and make install went fine. However, whenever I try to start F-Spot: user@ubuntu:~/unstable/f-spot/bin$ ./f-spot XXXXX Mono.Data.SqliteClient.SqliteSyntaxException: library routine called out of sequence in <0x00106> Mono.Data.SqliteClient.SqliteCommand:GetNextStatement (IntPtr pzStart, System.IntPtr pzTail, System.IntPtr pStmt) in <0x000d0> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32 rows_affected) in <0x0001d> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader (CommandBehavior behavior) in <0x0000c> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader () in <0x00011> Mono.Data.SqliteClient.SqliteCommand:ExecuteScalar () in <0x0005a> QueuedSqliteCommand:Execute () XXXXX
Dotan are you running 32 or 64 bit Ubuntu as I am running 64 and starting to wonder if there may be a difference in the libraries for Sqlite?
32 bit
Alright, I tried today to patch with this using the latest CVS. Didn't work: dotancohen@ubuntu:~/bin/development/f-spot/f-spot$ patch -p0 < thepatch.diff patching file src/JobScheduler.cs can't find file to patch at input line 602 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- | |=== modified file '.bzrignore' |--- .bzrignore 2006-09-01 14:37:48 +0000 |+++ .bzrignore 2006-09-03 10:37:26 +0000 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored patching file FlickrNet/Makefile.am Reversed (or previously applied) patch detected! Assume -R? [n] Apply anyway? [n] Skipping patch. Line 602 looks like this: @@ -1,1 +1,61 @@ Should I choose Y or N when it asks "Skip this patch" the first time? Also, for the remainder of the files (FlickrNet/Makefile.am for example) it thinks that it found a reversed patch. Should I answer Y or N when it asks "Assume -R?" and "Apply anyway?"?
Created attachment 78617 [details] [review] f-spot-jobscheduler-3.patch Here's a rediff against current HEAD. It works, but it can hang on closing f-spot (just don't know how to trigger it). Also, this needs major rewriting, so it's just provided for those who want it.
2007-06-18 Stephane Delcroix <stephane@delcroix.org> * src/Makefile.am * src/Jobs * src/Jobs/JobPriority.cs * src/Jobs/Scheduler.cs * src/Jobs/FSpotCompat.cs * src/Jobs/IntervalHeap.cs * src/Jobs/IInstanceCriticalJob.cs * src/Jobs/IJob.cs: Job Scheduler borrowed from Banshee * src/Db.cs: * src/Jobs/JobStatus.cs: * src/JobStore.cs: abstraction layer for db and scheduler * src/Jobs/SyncMetadataJob.cs: * src/MainWindow.cs: Write metadata as asynchronous job