Sarcasm / company-irony

company-mode completion back-end for irony-mode
119 stars 11 forks source link

Timeout errors #3

Closed elemakil closed 10 years ago

elemakil commented 10 years ago

I'm experiencing timeout errors, namely:

Company: Back-end company-irony async timeout with args (candidates )

When I kill the buffer, reopen the file and re-execute irony-cdb-menu for loading the compilation DB, completion works fine again (for some time).

Below you can find the backtrace starting at company-complete-common, which is my entry-point for completion; note that <$$BYTECODE$$> is a placeholder for some byte-code like part of the backtrace which can not be pasted into github:

Debugger entered--Lisp error: (error "Company: Back-end company-irony async timeout with args (candidates )")
  signal(error ("Company: Back-end company-irony async timeout with args (candidates )"))
  error("Company: Back-end %s async timeout with args %s" company-irony (candidates ""))
  company--force-sync(company-call-backend-raw (candidates "") company-irony)
  company-call-backend(candidates "")
  company--fetch-candidates("")
  company-calculate-candidates("")
<$$BYTECODE$$>
  company--begin-new()
  company--perform()
  #[0 "\300 \207" [company--perform] 1 "\n\n(fn)"]()
  company-auto-begin()
  company-manual-begin()
  company-complete-common()
Sarcasm commented 10 years ago

Did you update irony-mode since last night or does this error comes from a previous version?

For me usually the first time a completion occurs the timeout may be reached, since the file has to be parsed twice by libclang and then it keeps some things in cache and completion should perform better.

But if it happens even after the first parse maybe something is wrong. If you set a higher value for the timeout by customizing company-async-timeout, i.e: M-: (setq company-async-timeout 10) RET, does the completion returns with meaningful results?

elemakil commented 10 years ago

Did you update irony-mode since last night or does this error comes from a previous version?

Eh... I just updated and in my simple test case the problem does not exist anymore. It seems that last night's update fixed the problem whatever it was. I'll close this issue if the problem does not reappear till the end of the day.

Sarcasm commented 10 years ago

I was expecting last night commit to make things the same or slightly worse (but pretty sure it's unnoticeable), but not faster. But 6 days ago a commit should have made things better, so maybe it's the one that solved your problem, completion should perform better since this commit.

soonhokong commented 9 years ago

Dear @Sarcasm,

I'm not sure that this is related with https://github.com/Sarcasm/flycheck-irony/issues/3. But I do have the following message when I run company-complete-common.

FYI, I'm using OS X 10.10.2. I've tried different llvm versions -- 3.4, 3.5, 3.6, and different versions of emacs24.4 (24.4.1, 24.4.91). I can reproduce the problem in all combinations.

By the way, in Ubuntu, things are working in an expected way.

Debugger entered--Lisp error: (error "Company: Back-end company-irony async timeout with args (candidates )")
  signal(error ("Company: Back-end company-irony async timeout with args (candidates )"))
  error("Company: Back-end %s async timeout with args %s" company-irony (candidates ""))
  company--force-sync(company-call-backend-raw (candidates "") company-irony)
  company-call-backend(candidates "")
  company--fetch-candidates("")
  company-calculate-candidates("")
  #[0 "\n\203   \nC\202\n\211\205\220\211@\3009\204\306!\203<9\2036\307N\310=\2046\307N?\205@\311!\205@\312!\202@\313\312\"\240\210\300\242\203\211\314\300\242!\203\203\315\300\242!\211\301\316\f!\240\210\301\242:\204l
\203\203\317\320!\210\202\203
\203t\300\242\321\301\242!\210\322\323\324 \"\210\325\326!\210\327\330\301\242\"\210A\266\202\202\n\207" [(("" . t)) (nil) company-backend company-backends company-prefix company--manual-action functionp company-init t company-init-backend prefix company--multi-backend-adapter company--good-prefix-p company--prefix-str company-calculate-candidates message "No completion found" company-update-candidates run-hook-with-args company-completion-started-hook company-explicit-action-p company-call-frontends show throw --cl-block-nil-- company--manual-prefix] 6 "\n\n(fn)"]()
  funcall(#[0 "\n\203   \nC\202\n\211\205\220\211@\3009\204\306!\203<9\2036\307N\310=\2046\307N?\205@\311!\205@\312!\202@\313\312\"\240\210\300\242\203\211\314\300\242!\203\203\315\300\242!\211\301\316\f!\240\210\301\242:\204l
\203\203\317\320!\210\202\203
\203t\300\242\321\301\242!\210\322\323\324 \"\210\325\326!\210\327\330\301\242\"\210A\266\202\202\n\207" [(("" . t)) (nil) company-backend company-backends company-prefix company--manual-action functionp company-init t company-init-backend prefix company--multi-backend-adapter company--good-prefix-p company--prefix-str company-calculate-candidates message "No completion found" company-update-candidates run-hook-with-args company-completion-started-hook company-explicit-action-p company-call-frontends show throw --cl-block-nil-- company--manual-prefix] 6 "\n\n(fn)"])
  company--begin-new()
  company--perform()
  #[0 "\301 \210\207" [company-candidates company--perform] 1 "\n\n(fn)"]()
  funcall(#[0 "\301 \210\207" [company-candidates company--perform] 1 "\n\n(fn)"])
  company-auto-begin()
  company-manual-begin()
  company-complete-common()
Sarcasm commented 9 years ago

I don't think it is linked with this issue. If your project isn't properly configured Clang may not be able to cache the preamble, making the completion really costly. Do you know if your file compiles without any issue on OS X?

soonhokong commented 9 years ago

@Sarcasm, it compiles with the installed clang++. FYI, irony-cdb-menu gives me the following:

Compilation Database: irony-cdb-json

  Working Directory: /Users/soonhok/work/dReal3/build/debug-clang
  Compile Options:   -Wall -Wextra -std=c++11 -Wno-mismatched-tags -Qunused-arguments -stdlib=libc++ -g -DDREAL_DEBUG -DDREAL_TRACE -fno-inline -Iinclude -Iinclude/ibex -I/Users/soonhok/work/dReal3/src -I/Users/soonhok/work/dReal3/src/opensmt -I.

[q] to quit

Also, there are some files in my project where irony-mode is working as expected.

Sarcasm commented 9 years ago

Can you try to leave out the -Qunused-arguments just to see if there is an issue with any of the options?

But please create a new issue I will not reopen this one as it is not related and I may forget about your issue otherwise.

soonhokong commented 9 years ago

Can you try to leave out the -Qunused-arguments just to see if there is an issue with any of the options?

Yes, this fixes my problem. Is it what we're supposed to do?

But please create a new issue

Please let me know if you still want me to open an issue for this.

Sarcasm commented 9 years ago

I created a sepate issue #8.