Page MenuHomePhabricator

MT API failure is not gracefully handled
Closed, ResolvedPublic


Load a translation to translation view and then stop cxserver. Try translating a section. A popup saying MT failed will appear on the top side of screen. The progress indicator will continue to show. Ideally the progress indicator should go away and placeholder should be retained


Related Gerrit Patches:
mediawiki/extensions/ContentTranslation : masterCX2: Handle the MT failures gracefully

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 30 2018, 12:13 PM
Pginer-WMF triaged this task as Medium priority.Aug 1 2018, 1:22 PM
Pginer-WMF moved this task from Needs Triage to Bugs on the ContentTranslation board.
santhosh claimed this task.Aug 3 2018, 10:28 AM

Change 450210 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] CX2: Handle the MT failures gracefully

Change 450210 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] CX2: Handle the MT failures gracefully

Petar.petkovic removed a project: Patch-For-Review.
Petar.petkovic removed a subscriber: gerritbot.

After this patch, users are no longer stuck with three loading dots after MT translation fails. When the failure happens, we show "Add translation" placeholder again.

In some cases, no matter how many times we try, we're just gonna get the same failure again. One such case is when translating really big section, like some tables. That scenario leads to 500 internal server error because request payload is too large.

Such errors are bound to happen no matter how many times we try. The question is: should we try being smart and predict some scenarios where user simply cannot translate the section? How would we communicate that in the UI?

@santhosh, should we deal with payload limit errors more gracefully regardless of translate-retry cycles I speak above? Should we strip the payload not to get this error?

    message: "request entity too large",
    expected: 107790,
    length: 107790,
    limit: 102400,
    type: "entity.too.large"

@Petar.petkovic If there are 5 continuous save failures, we show a red error banner at the top of the translation view. All schedulers will be stopped. Ref the following code snippet.

			if ( this.failCounter > 5 ) {
				// If there are more than a few errors, stop autosave at timer triggers.
				// Show a bigger error message at this point.
				this.translationView.showMessage( 'error', mw.msg( 'cx-save-draft-error' ) );
				// This will allow any change to trigger save again
				this.failCounter = 0;
				mw.log.error( '[CX] Saving failed repeatedly. Stopping retries.' );
			} else {
				// Delay in seconds, failCounter is [1,5]
				delay = 60 * this.failCounter;
				// Schedule retry.
				setTimeout( this.processSaveQueue.bind( this, true ), delay * 1000 );
				mw.log( '[CX] Retry scheduled in ' + delay / 60 + ' minutes.' );

I am interested in knowing how you get this payload error. Any steps to reproduce? Are we queuing up too much data and sending in request by any chance?

I am interested in knowing how you get this payload error. Any steps to reproduce? Are we queuing up too much data and sending in request by any chance?

Created T202283: CX2: Big sections are untranslatable, where one example is provided. Errors occur when you try to "Add translation" and MT fails because of big payload. I don't think we queue these request, so that isn't the problem.

Pginer-WMF closed this task as Resolved.Sep 3 2018, 9:23 AM