Timeouts

The user just sees Error and "Authorisation failed." etc. On the server side, I see log entries like the following:

[Mon Aug 20 12:49:43 2018] [error] Worker 29961 has no heartbeat (30 seconds), restarting
[Mon Aug 20 12:49:43 2018] [info] Stopping worker 29961 gracefully (120 seconds)
[Mon Aug 20 12:49:43 2018] [info] Worker 30471 started
[Mon Aug 20 12:49:43 2018] [info] Worker 29961 stopped
[Mon Aug 20 12:49:44 2018] [info] 178.209.50.237 GET http://communitywiki.org:8080/trunk/do/follow?code=***&account=***&name=*** 500 0.1641s

Apparently remote following can take too long. This makes sense as we're remote following one after the other.

How can this be solved without resorting to Javascript?

Tags: Closed

Reopen issue

Comments

When rewriting the code to use threads, I run into problems. The output when running my code under morbo:

Thread 1 terminated abnormally: main=HASH(0x55e52a246798) at /home/alex/src/trunk/trunk.pl line 189.
Thread 2 terminated abnormally: main=HASH(0x55e52bfec730) at /home/alex/src/trunk/trunk.pl line 189.
Thread 3 terminated abnormally: main=HASH(0x55e52d949a78) at /home/alex/src/trunk/trunk.pl line 189.
Thread 4 terminated abnormally: main=HASH(0x55e52f2b6f08) at /home/alex/src/trunk/trunk.pl line 189.
Thread 5 terminated abnormally: main=HASH(0x7ffb64005cf8) at /home/alex/src/trunk/trunk.pl line 189.
Thread 6 terminated abnormally: main=HASH(0x55e53259c3c0) at /home/alex/src/trunk/trunk.pl line 189.
Thread 7 terminated abnormally: main=HASH(0x55e533f0d420) at /home/alex/src/trunk/trunk.pl line 189.
Thread 8 terminated abnormally: main=HASH(0x7ffb780b1dd8) at /home/alex/src/trunk/trunk.pl line 189.
Thread 9 terminated abnormally: main=HASH(0x55e5371ec900) at /home/alex/src/trunk/trunk.pl line 189.
Thread 10 terminated abnormally: main=HASH(0x7ffb680dd228) at /home/alex/src/trunk/trunk.pl line 189.
	(in cleanup) object is not of type EV::Io at /home/alex/perl5/lib/perl5/Mojo/IOLoop/Stream.pm line 21.
	(in cleanup) object is not of type EV::Io at /home/alex/perl5/lib/perl5/Mojo/Server/Daemon.pm line 25.
Scalars leaked: -47
Attempt to free unreferenced scalar: SV 0x55e525b7af68, Perl interpreter: 0x55e53583e300 at /home/alex/perl5/lib/perl5/Mojo/IOLoop/Stream.pm line 74.
	(in cleanup) object is not of type EV::Io at /home/alex/perl5/lib/perl5/Mojo/IOLoop/Stream.pm line 21.
	(in cleanup) object is not of type EV::Io at /home/alex/perl5/lib/perl5/Mojo/Server/Daemon.pm line 25.
Attempt to free unreferenced scalar: SV 0x55e525bbd030, Perl interpreter: 0x55e53583e300 during global destruction.
Attempt to free unreferenced scalar: SV 0x55e525bcb5a8, Perl interpreter: 0x55e53583e300 during global destruction.
Scalars leaked: -1

Clearly, this is messed pup and somehow interferes with the Mojo::IOLoop that Mojolicious uses.

– Alex Schroeder 2018-08-21 08:34 UTC


Next attempt, using Mojo::IOLoop::Subprocess. Current status: request terminats, @results is empty. Communicating results seems to require a temporary file or a database and the code just kept growing and growing. Also, there was no easy way to join or wait for the subprocesses to finish. Thus I had written another loop that did nothing but check whether all the children had finished. It was terrible.

– Alex Schroeder 2018-08-21 09:54 UTC


I finally settled on using MCE::Loop which was recommended on the #perl channel and that seems to work!

– Alex Schroeder 2018-08-21 11:37 UTC


Tentatively closed!

– Alex Schroeder 2018-08-21 11:44 UTC


This wiki uses a variant of Markdown.

To save this page you must answer this question:

Please write "new issue" into the field below.