After the D7 upgrade, pift-cron is crashing due to PDO duplicate key issues during a db_update of pift_data.

This is likely coming from pift_test_sent(), which updates test request records with a test_id, after qa.d.o has assigned one for that test. The code assumes we have a unique identifier for test_id; but we are somehow getting a number of tests with '0' instead.

I suspect this may be occuring when a file is uploaded, the node is saved, and then it is saved and edited again before pift-cron has assigned the file a test_id. Either that, or the pift_test_add_files logic is broken ... but somehow tests are being double-queued.

Comments

jthorson’s picture

Ah ... figured out what's happening. Looks like something is triggering the re-testing of 'hidden' files, which are causing the duplicate records.

jthorson’s picture

Believe I need to rewrite pift_extract_untested_files() and pift_extract_files() to use EntityFieldQuery, and only queue up nodes which do not have display=0. Testing is temporarily unblocked again, and I'll tackle this tommorrow.

yched’s picture

FWIW, it happened to me on #2019055: Switch from field-level language fallback to entity-level language fallback, in comment #168 where I changed the issue to RTBC. Upon submitting the form, the next page displayed a sh*tload of "patch 2019055-xx.patch set to be retested" confirmation messages (one per patch in the issue, which was a *lot*).

jthorson’s picture

yched: And thanks for doing that ... because it wasn't until I realized all 46 duplicate records were from that same issue that I was able to deduce what was actually going on. :D

jthorson’s picture

jthorson’s picture

Status: Fixed » Needs work

Still occurs ... happened this morning on a 'retest' request in https://drupal.org/node/2123897

jthorson’s picture

Status: Needs work » Fixed

Only did half the job last time ... here's the other half.

http://drupalcode.org/project/project_issue_file_test.git/commit/c6fca85...

Merged into BZR, ready for the next drupal.org deploy.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.