https://bugzilla.redhat.com/show_bug.cgi?id=1142458
--- Comment #12 from Mike FABIAN <mfabian(a)redhat.com> ---
(In reply to Stas Sergeev from comment #11)
> The purpose of my question was whether code as followed
> has a reasonable chance to fix your problem or not:
I know, but I only answered to the part I am eligible
to answer: it does not fail more than once. I assume
there is already a loop somewhere on the higher levels,
that restarts the loading of the failed engine, because
it recovers in a second or so without my interaction.
As for the loop you suggest, I don't like it, it just
works around the problem in a very unreliable way
(heuristical timeouts are never reliable).
Yes, I don’t like that either and don’t want to include
a patch like that. There must be a better solution.
Could you please add some logging to your patch that
will log the fact of returning None from get_config()?
diff --git a/engine/table.py b/engine/table.py
index 7a8c150..244ace2 100644
--- a/engine/table.py
|
+++ b/engine/table.py
@@ -1096,8 +1096,16 @@ class tabengine (IBus.Engine):
self._config_section = "engine/Table/%s"
%self._engine_name.replace('
'
,'_')
# config module
- self._config = self._bus.get_config ()
- self._config.connect ("value-changed", self.config_value_changed_cb)
+ for i in range(0,9):
+ self._config = self._bus.get_config ()
+ if self._config:
+ break
+ sys.stderr.write('self._bus.get_config() returned None.')
+ time.sleep(0.1)
+ if self._config:
+ self._config.connect ("value-changed",
self.config_value_changed_cb
)
+ else:
+ print('Error: could not connect callback for config value
changes.'
)
# self._ime_py: Indicates whether this table supports pinyin mode
self._ime_py = self.db.ime_properties.get('pinyin_mode')
I can't reproduce the problem right now for the aforementioned
reasons, and as such, I may mistakenly attribute a
successful testing to your patch. So the recovery
attempts must be logged, if possible.
--
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug
https://bugzilla.redhat.com/token.cgi?t=AFFaX8Auin&a=cc_unsubscribe