Page MenuHomePhabricator

API errors occasionally with unknown error 231
Closed, ResolvedPublic

Description

When doing multiple automatic edits I occasionally get unknown error 231 in between the database lock errors.


Version: unspecified
Severity: normal

Details

Reference
bz29246

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 11:37 PM
bzimport set Reference to bz29246.

This is caused by the following sequence of events:

  • Article::doEdit() fails, and returns a Status object with failure info
  • EditPage::internalAttemptSave() checks for $status->isOK(), and returns AS_END if $status signifies an error. The Status object is discarded
  • API doesn't handle AS_END, falls through to returning an unknown error. There's a comment here about needing to propagate the Status object

I guess the best way to fix this would be to refactor internalAttemptSave() to return a Status object instead of one of 30+ error codes.

(In reply to comment #1)

I guess the best way to fix this would be to refactor internalAttemptSave() to
return a Status object instead of one of 30+ error codes.

Please! For back-compat, you can set the error code in $status->value on failure.

(In reply to comment #2)

(In reply to comment #1)

I guess the best way to fix this would be to refactor internalAttemptSave() to
return a Status object instead of one of 30+ error codes.

Please! For back-compat, you can set the error code in $status->value on
failure.

Thanks for that tip. I took it a little bit further and just made all flow decisions based on $status->value, because EditPage is such a mess.

Fixed in r95562.