After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 627999 - Cannot autocomplete with contacts
Cannot autocomplete with contacts
Status: RESOLVED FIXED
Product: evolution-mapi
Classification: Applications
Component: Contacts (Addressbook)
0.31.x
Other Linux
: Normal critical
: ---
Assigned To: evolution-mapi-maint
evolution-mapi-maint
: 578954 626193 627332 630846 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-08-26 06:14 UTC by Akhil Laddha
Modified: 2010-10-13 07:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed ema patch (7.84 KB, patch)
2010-08-30 10:12 UTC, Milan Crha
none Details | Review
proposed ema patch ][ (8.99 KB, patch)
2010-08-30 11:07 UTC, Milan Crha
none Details | Review
proposed ema patch ]I[ (10.12 KB, patch)
2010-08-31 10:45 UTC, Milan Crha
none Details | Review
ema patch IV (10.12 KB, patch)
2010-08-31 14:44 UTC, Milan Crha
committed Details | Review

Description Akhil Laddha 2010-08-26 06:14:18 UTC
evolution 2.31.91

When i try to auto complete any email id in mapi address book, i get time out and auto completion will be unsuccessful. Though in contact view, if i click on address book, i see the contact.

Note - i deleted old (migrated) address book cache and fetched fresh one.

gdb traces of evolution

  • #0 g_logv
    at gmessages.c line 430
  • #1 g_log
    at gmessages.c line 568
  • #2 book_loaded_cb
    at e-name-selector-entry.c line 1972
  • #3 g_simple_async_result_complete
    at gsimpleasyncresult.c line 692
  • #4 complete_in_idle_cb_for_thread
    at gsimpleasyncresult.c line 757
  • #5 g_idle_dispatch
    at gmain.c line 4224
  • #6 g_main_dispatch
    at gmain.c line 2119
  • #7 g_main_context_dispatch
    at gmain.c line 2672
  • #8 g_main_context_iterate
    at gmain.c line 2750
  • #9 g_main_loop_run
    at gmain.c line 2958
  • #10 IA__gtk_main
    at gtkmain.c line 1219
  • #11 main
    at main.c line 645

Comment 1 Milan Crha 2010-08-27 10:11:25 UTC
Confirming, I see this too, with mapi accounts.
Comment 2 Milan Crha 2010-08-27 14:41:08 UTC
I run e-addressbook-factory from the terminal with latest openchange and samba4 and I see error like:
../librpc/rpc/dcerpc.c:181: Type mismatch: name[DATA_BLOB: ../../librpc/ndr/ndr_basic.c:1132] expected[struct tevent_req]

which leads to a crash. It seems that a thread-safety of openchange is required here, or to make ema less threading (my effort to actually speed up things, with a paralelism).
Comment 3 Milan Crha 2010-08-30 08:56:08 UTC
OK, basically openchange and samba4 are not thread safe, and my recent rewrite to make ema more threading-like uncovers this issue in more visible manner. I'm not much willing to have a global connection lock, because it'll make ema slow again, but it seems we have no other option. I will also make notification optional, though on by default, because its invocation is unpredictable with respect of other threads. I'll see and update this bug report when I'll have something.
Comment 4 Milan Crha 2010-08-30 10:12:47 UTC
Created attachment 169042 [details] [review]
proposed ema patch

for evolution-mapi;

- every (most of) operation on mapi is guarded with a global lock
- use MAPI_NO_NOTIFY=1 to disable notifications
- EBookBackend's summary was rewritten with a cache (little typo in the code).
  Let it fetch items twice and it'll be fine ok.
Comment 5 Milan Crha 2010-08-30 10:26:25 UTC
*** Bug 627332 has been marked as a duplicate of this bug. ***
Comment 6 Milan Crha 2010-08-30 11:07:55 UTC
Created attachment 169047 [details] [review]
proposed ema patch ][

for evolution-mapi;

Almost same as the earlier one, only doesn't block global lock in the fetching callbacks, giving a chance to others to work too.
Comment 7 Akhil Laddha 2010-08-30 12:34:35 UTC
Initial results say that patch may not be enough.

What are the problems i see 

1) I have cached a mapi address book out of 5 mapi address books and that address book has 900 contacts. I see all the contacts of that address book in contact view. Now if i try to compose a mail, click on 'To' and search for a contact which is there for sure in that particular address book, i see 'searching' but no result.

I see timeout on evolution terminal.

2) Now when i clear the search and go back to contact view, i see empty address book which showed 900 contacts before doing search.

3) Contacts downloading is still very slow.

4) One of address book with name 'Contacts' which shows 20 contacts in owa, doesn't show anything in evolution.

If you want, i can do more testing tomorrow.
Comment 8 Milan Crha 2010-08-30 20:22:25 UTC
Thanks for testing it.

ad 3) hmm, 5 mapi address books, it might explain the slowness, because right now is anything in the ExchangeMapiConnection guarded with a global lock, which means only one of those can call libampi functions, and others are just waiting for it.

ad 4) might be it's in the pile of "to be done" books

The thing is that when the summary file was rewritten with a cache file, and cache file is now the old file, then it'll always load a whole addressbook on its load. Which may mean in your case a pretty huge loading. As soon as it updates the local cache as expected, the autocompletion should be fine again, together with 1) and 2). It was behaving like running ema account for the first time, with no local cache filled.
Comment 9 Milan Crha 2010-08-31 10:45:33 UTC
Created attachment 169150 [details] [review]
proposed ema patch ]I[

for evolution-mapi;

The third attempt, hopefully the last one. It should also fix the slowness you noticed while fetching GAL.
Comment 10 Akhil Laddha 2010-08-31 11:19:47 UTC
That works neat, gal download is fast though i see evolution cpu goes 100% some times when i launch new -> composer in middle of fetching contacts.
Comment 11 Akhil Laddha 2010-08-31 11:44:56 UTC
*** Bug 626193 has been marked as a duplicate of this bug. ***
Comment 12 Milan Crha 2010-08-31 14:44:52 UTC
Created attachment 169167 [details] [review]
ema patch IV

for evolution-mapi;

Thanks for testing. This patch is almost the same as the previous one, the only difference is that the notifications are disabled by default. To enable them one should use MAPI_LISTEN_NOTIFY environment variable. There is no go due to thread unsafety of libmapi/samba4 code.

With respect of 100% CPU, please try to get a backtrace of such situation, maybe we can address it. It's OK to provide it on IRC/pastebin. Thanks in advance.
Comment 13 Milan Crha 2010-08-31 14:46:00 UTC
Created commit bdfbaf6 in ema master (0.31.92+)
Comment 14 Milan Crha 2010-10-12 12:59:59 UTC
*** Bug 630846 has been marked as a duplicate of this bug. ***
Comment 15 Milan Crha 2010-10-13 07:53:46 UTC
*** Bug 578954 has been marked as a duplicate of this bug. ***