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
=== modified file 'libgeis/geis.c'
--- libgeis/geis.c 2012-07-24 16:04:12 +0000
+++ libgeis/geis.c 2012-08-06 23:41:19 +0000
@@ -63,7 +63,8 @@
63typedef enum _GeisState63typedef enum _GeisState
64{64{
65 GEIS_STATE_INITIALIZING,65 GEIS_STATE_INITIALIZING,
66 GEIS_STATE_RUNNING66 GEIS_STATE_RUNNING,
67 GEIS_STATE_INIT_FAIL
67} _GeisState;68} _GeisState;
6869
6970
@@ -230,6 +231,7 @@
230 {231 {
231 geis_error_push(NULL, GEIS_STATUS_UNKNOWN_ERROR);232 geis_error_push(NULL, GEIS_STATUS_UNKNOWN_ERROR);
232 geis_error("can not create back end");233 geis_error("can not create back end");
234 geis->state = GEIS_STATE_INIT_FAIL;
233 }235 }
234 geis->backend_use_fallback = GEIS_FALSE;236 geis->backend_use_fallback = GEIS_FALSE;
235}237}
@@ -286,6 +288,10 @@
286 geis->backend_pending = GEIS_FALSE;288 geis->backend_pending = GEIS_FALSE;
287 handled = GEIS_TRUE;289 handled = GEIS_TRUE;
288 }290 }
291 else
292 {
293 geis->state = GEIS_STATE_INIT_FAIL;
294 }
289 break;295 break;
290296
291 default:297 default:
@@ -661,6 +667,7 @@
661 geis_error_push(NULL, GEIS_STATUS_UNKNOWN_ERROR);667 geis_error_push(NULL, GEIS_STATUS_UNKNOWN_ERROR);
662 geis_error("can not create back end");668 geis_error("can not create back end");
663 status = GEIS_FALSE;669 status = GEIS_FALSE;
670 geis->state = GEIS_STATE_INIT_FAIL;
664 }671 }
665 }672 }
666673
@@ -705,6 +712,10 @@
705 status = GEIS_STATUS_SUCCESS;712 status = GEIS_STATUS_SUCCESS;
706 break;713 break;
707 }714 }
715 else if (geis->state == GEIS_STATE_INIT_FAIL)
716 {
717 break;
718 }
708 }719 }
709 }720 }
710721

Subscribers

People subscribed via source and target branches