Skip Menu |
 

This queue is for tickets about the TheSchwartz CPAN distribution.

Report information
The Basics
Id: 65097
Status: stalled
Priority: 0/
Queue: TheSchwartz

People
Owner: Jeff.Fearn [...] gmail.com
Requestors: Nicolas.Franck [...] UGent.be
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: TheSchwartz::ExitStatus
Date: Tue, 25 Jan 2011 09:46:22 +0100
To: bug-TheSchwartz [...] rt.cpan.org
From: "Nicolas Franck" <Nicolas.Franck [...] UGent.be>
Hi my name is Nicolas Franck. This is my system: Ubuntu 10.04 LTS 64-bit version of TheSchwartz: 1.10 version of perl 5.10.1 the code is supplied in the attachments Explaining: My code consist of 3 parts: - daemon with the ability 'TheSchwartz::Worker::Download' - the worker 'TheSchwartz::Worker::Download' itself - client code that insert job into the database by means of the api Problem: As long as the method 'keep_exit_status_for' in the worker is set as '0', everything works just fine. The method 'grab_for' is set to 1 in order to debug fast, and 'max_retries' to 0. But if I try to increase the number of 'keep_exit_status_for', the following error appears in the daemon: TheSchwartz::work_once got job of class 'TheSchwartz::Worker::Download' Working on TheSchwartz::Worker::Download ... Eval failure: Failed to execute INSERT INTO exitstatus (jobid, status, funcid, completion_time, delete_after) VALUES (?, ?, ?, ?, ?) with jobid, status, funcid, completion_time, delete_after: DBD::mysql::st execute failed: Duplicate entry '1' for key 'PRIMARY' at /usr/local/share/perl/5.10.1/Data/ObjectDriver/Driver/DBI.pm line 393. job failed. considering retry. is max_retries of 0 >= failures of 1? job failed: Failed to execute INSERT INTO exitstatus (jobid, status, funcid, completion_time, delete_after) VALUES (?, ?, ?, ?, ?) with jobid, status, funcid, completion_time, delete_after: DBD::mysql::st execute failed: Duplicate entry '1' for key 'PRIMARY' at /usr/local/share/perl/5.10.1/Data/ObjectDriver/Driver/DBI.pm line 393. Failed to execute INSERT INTO exitstatus (jobid, status, funcid, completion_time, delete_after) VALUES (?, ?, ?, ?, ?) with jobid, status, funcid, completion_time, delete_after: DBD::mysql::st execute failed: Duplicate entry '1' for key 'PRIMARY' at /usr/local/share/perl/5.10.1/Data/ObjectDriver/Driver/DBI.pm line 393. It's appears that the entry in the table 'exitstatus' was already inserted before exiting (while it should only do that after the exit). Any bright idea's on how to fix this? Thanks in advance, Nicolas Franck
Download daemon.pl
text/x-perl 439b

Message body is not shown because sender requested not to inline it.

Download Download.pm
text/x-perl 5k

Message body is not shown because sender requested not to inline it.

Download (untitled) / with headers
text/plain 421b
Hi Nicolas, I believe the issue is that in your code you call set_exit_status before you call completed, however completed also calls set_exit_status, and thus there are two entries being created. It's probably that you need to * drop the call to set_exit_status on line 162 * replace the content of the else starting on line 164 with a call to failed. If this is no longer an issue please let me know. Cheers, Jeff.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.