Page MenuHomePhabricator

QuickStatements batch running in background not stopping with the stop button
Closed, ResolvedPublic


This morning I started a QuickStatements batch 18572, started to run it in background, discovered I made a mistake and clicked on "stop" after something like ~100 edits, then clicked on "revert the batch". Except that the batch didn't stop.

It visually didn't show me the stop button anymore, as if that had worked, but the numbers of edits continued to grow (and the edits were made). And the "revert the batch" part worked only for a very small part of the batch. I cleaned up everything this evening so there is no wrong data on Wikidata but I did make thousands of edits today which were wrong and which I thought I had stopped.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 15 2019, 8:56 PM
LucasWerkmeister added a comment.EditedSep 15 2019, 9:04 PM

I’ve looked into this a little bit. As far as I can tell, it should work in principle – PHP sets the status field in the database to STOP, and Rust only selects batches with certain statuses to run, not including STOP.

But I think the JS side is missing some error handling. PHP will attach an error message to the JSON response ("status" field), but it’s not read as far as I can tell:

$.post ( me.api , {
} , function ( d ) {
 $('#working').hide() ;
 me.loadBatchInfo( ;
} , 'json' ) ;

(This code is from the Vue component, but the non-Vue version seems to behave similarly.) So if the PHP side failed to stop the batch for any reason, then I think the JS side would still have removed the “stop” button and otherwise acted as if the batch was successfully stopped.

That's true, but a reload of the batch page should return the STOP button, as its state is only read from the database. The bot, in turn, only checks the database (or should, I suspect it doesn't).

Bot code patched, deployed, someone please test

Tested - works for me in situation in which it previously didn't work.

Magnus closed this task as Resolved.Sep 17 2019, 9:25 AM