Merge lp:~bregma/geis/lp-997630 into lp:geis

Proposed by Stephen M. Webb
Status: Merged
Merged at revision: 280
Proposed branch: lp:~bregma/geis/lp-997630
Merge into: lp:geis
Diff against target: 50 lines (+12/-1)
1 file modified
libgeis/geis.c (+12/-1)
To merge this branch: bzr merge lp:~bregma/geis/lp-997630
Reviewer Review Type Date Requested Status
Chase Douglas (community) Approve
Review via email: mp+118440@code.launchpad.net

Description of the change

Integrates patch suggested by Bradley M. Froehle to avoid waiting for a timeout on complete initialization failure.

Should fix the parts of lp:997630 not already fixed.

To post a comment you must log in.
Revision history for this message
Chase Douglas (chasedouglas) wrote :

Looks good to me. I'm going to apply this manually and switch the author to Bradley so he gets the glory due to him :).

review: Approve
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

I bet there could be a test for this, if you mock here and there.

Revision history for this message
Stephen M. Webb (bregma) wrote :

There's already a test for it, but it needs to have some kind of timer added to indicate if it fails in less than some arbitrary and perceptible time.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libgeis/geis.c'
2--- libgeis/geis.c 2012-07-24 16:04:12 +0000
3+++ libgeis/geis.c 2012-08-06 23:41:19 +0000
4@@ -63,7 +63,8 @@
5 typedef enum _GeisState
6 {
7 GEIS_STATE_INITIALIZING,
8- GEIS_STATE_RUNNING
9+ GEIS_STATE_RUNNING,
10+ GEIS_STATE_INIT_FAIL
11 } _GeisState;
12
13
14@@ -230,6 +231,7 @@
15 {
16 geis_error_push(NULL, GEIS_STATUS_UNKNOWN_ERROR);
17 geis_error("can not create back end");
18+ geis->state = GEIS_STATE_INIT_FAIL;
19 }
20 geis->backend_use_fallback = GEIS_FALSE;
21 }
22@@ -286,6 +288,10 @@
23 geis->backend_pending = GEIS_FALSE;
24 handled = GEIS_TRUE;
25 }
26+ else
27+ {
28+ geis->state = GEIS_STATE_INIT_FAIL;
29+ }
30 break;
31
32 default:
33@@ -661,6 +667,7 @@
34 geis_error_push(NULL, GEIS_STATUS_UNKNOWN_ERROR);
35 geis_error("can not create back end");
36 status = GEIS_FALSE;
37+ geis->state = GEIS_STATE_INIT_FAIL;
38 }
39 }
40
41@@ -705,6 +712,10 @@
42 status = GEIS_STATUS_SUCCESS;
43 break;
44 }
45+ else if (geis->state == GEIS_STATE_INIT_FAIL)
46+ {
47+ break;
48+ }
49 }
50 }
51

Subscribers

People subscribed via source and target branches