Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on multiple instances of ACE #384

Open
thiagoeec opened this issue Jun 16, 2023 · 3 comments
Open

Error on multiple instances of ACE #384

thiagoeec opened this issue Jun 16, 2023 · 3 comments

Comments

@thiagoeec
Copy link
Contributor

thiagoeec commented Jun 16, 2023

Ever since I upgraded from 1.2.7 to 1.3.1, I'm having trouble on launching multiple instances of ACE simultaneously. It never happened before, but now I'm getting this type of errors on stdout:

did-fail-load: -3 - - acehttps://0.0.0.0//OEBPS/Text/book-2.html?AXE_RUNNER=2 - true - 6 - 1
did-fail-load: -3 - - acehttps://0.0.0.0//OEBPS/Text/cover.html?AXE_RUNNER=0 - true - 4 - 1
did-fail-load: -3 - - acehttps://0.0.0.0//OEBPS/Text/book-1.html?AXE_RUNNER=1 - true - 5 - 1

When this happens, I get a return code of 1, and no report is generated. Only some books of the batch are affected.

Background:

  1. I'm running ACE as part of a calibre plugin (Check Books).
  2. It is written in python and uses subprocess.Popen() to run ACE.
  3. stdout and stderr are directed to subprocess.PIPE
  4. Since PIPE has a limited size, I'm running ACE in silent mode: args = 'ace -s -f -o check_books_path -l user_lang book_path'
  5. The multiple instances of ACE are being launched using multi-threading: threading.Thread()

Workaround:

Temporarily, I've modified the code to rerun ACE on books that get this type of error. Running a second time usually solves the problem. Also, when running a single instance, the error does not happen.

My system:

  • Version of Ace impacted by the issue: 1.3.1
  • Version of Node used to run Ace: v19.8.1
  • My operating system and version: Windows 10 22H2, 19045.3086
@danielweck
Copy link
Member

Very interesting, thank you. Could you please try invoking the ace-puppeteer executable instead of ace (which is now a synonym for ace-electron).

@thiagoeec
Copy link
Contributor Author

thiagoeec commented Jun 20, 2023

I just tried using ace-puppeteer, and it worked perfectly. All books were processed.
The problem seems to be related to ace-electron.

P.S.: I did notice a speed diference, though. Using ace-electron seems to be a lot faster, even if it had to rerun the check on the failing books.

@danielweck
Copy link
Member

This is valuable feedback, thank you.

I suspected that the Electron option (now default) would be a net improvement in terms of performance and consistency (same engine in Ace command line and Ace App / GUI), so hopefully we will soon figure out how to fix the "multiple processes" bug.

The Puppeteer version currently integrated in Ace is slightly old (compared with Electron which ships a recent NodeJS and Chromium runtime) due to technical limitations / incompatible software dependencies. However I dont anticipate Puppeteer to have become much faster, even with their switch from Chromium to Google Chrome.

As you witnessed yourself, in some/many cases we are looking at Ace's Electron integration being twice as fast as with Puppeteer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants