Skip to content

fix(replication): surface HTTP 413 via paused/error events#9185

Open
Mayankaggarwal8055 wants to merge 1 commit intoapache:masterfrom
Mayankaggarwal8055:fix/9165-413-replication
Open

fix(replication): surface HTTP 413 via paused/error events#9185
Mayankaggarwal8055 wants to merge 1 commit intoapache:masterfrom
Mayankaggarwal8055:fix/9165-413-replication

Conversation

@Mayankaggarwal8055
Copy link
Copy Markdown

Fixes #9165

HTTP 413 (Content Too Large) from CouchDB _bulk_docs during live replication was silently retried via backOff() instead of surfacing through paused(err) events as users expect.

Solution: In completeReplication(), treat 413 as fatal - emit paused(error) + error(error) and stop retrying.

Changes:

+ } else if (fatalError.status === 413) {
+   returnValue.emit('paused', fatalError);
+   returnValue.emit('error', fatalError);
+   returnValue.removeAllListeners();
+ } else {
    backOff(opts, returnValue, fatalError, function () {
      replicate(src, target, opts, returnValue);
    });

@Mayankaggarwal8055
Copy link
Copy Markdown
Author

Mayankaggarwal8055 commented Mar 6, 2026

Hi @janl @alxndrsn @SCdF ,

This PR addresses issue #9165 by surfacing HTTP 413 errors during live replication through paused(err) and error(err) events instead of silently retrying.

Currently the workflow is awaiting maintainer approval before CI can run.
Whenever you have time, could you please take a look and approve the workflow so the checks can start?

Thanks!

@alxndrsn
Copy link
Copy Markdown
Contributor

alxndrsn commented Mar 6, 2026

Hi @janl @alxndrsn @SCdF ,

Please don't tag me in comments unless specifically relevant.

@Mayankaggarwal8055
Copy link
Copy Markdown
Author

Hey @janl , could you please take a look at this when you have a moment?

This PR addresses the issue where HTTP 413 errors during live replication were being silently retried instead of being surfaced properly. The change treats 413 as a fatal error and emits paused(err) and error(err) events so users can handle it as expected.

The fix is minimal and keeps the existing flow intact while improving error visibility.

Also, the workflow is currently awaiting maintainer approval—could you please approve it so the CI checks can run?

Thanks! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTP 413 during live replication is not surfaced via replication events

2 participants