Skip to content

Changes

Started 1 mo 3 days ago
Took 0 ms on built-in

Summary

  1. fix(webhook): bound WebhookRetryProcessor memory with batches, skip paused endpoints (#538) (commit: 19880d6) (details)
Commit 19880d6384f91804143872262e0670d9272121d0 by noreply
fix(webhook): bound WebhookRetryProcessor memory with batches, skip paused endpoints (#538)

* fix(webhook): bound WebhookRetryProcessor memory with batches, skip paused endpoints

Fixes bxservice/idempiere-rest#537

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(webhook): cover getPendingRetries batching and paused-endpoint exclusion

Refs bxservice/idempiere-rest#537

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(webhook): enforce retry runtime limit per delivery, not per batch

Refs bxservice/idempiere-rest#537

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(webhook): use Query.iterate() for pending retries instead of keyset batches

Refs bxservice/idempiere-rest#537

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* perf(webhook): stream pending retries to avoid N+1 row loads

Query.iterate() loads IDs up front and re-fetches each row with a separate
SELECT, which means one query per delivery on a backlog of millions.
Switch to Query.stream() so each delivery is built straight off the open
result set, and re-run the query per batch of COMMIT_INTERVAL so commits
never happen while the cursor is open. Processed rows leave the WHERE
clause, so each fresh batch continues where the previous one stopped.

Refs #537

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(webhook): cap pending-retry query with SQL LIMIT per batch

Query.stream() sets no fetch size, so pgJDBC buffers the whole result set
before the first row is read; stopping after COMMIT_INTERVAL rows in Java
still loaded the entire backlog. Pass the batch size into
streamPendingRetries and apply it via setPageSize, so each query returns
at most one batch. No OFFSET is needed since processed rows leave the
WHERE clause.

Also check the runtime deadline before opening each batch query.

Refs #537

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(commit: 19880d6)
The file was modifiedcom.trekglobal.idempiere.rest.api/src/com/trekglobal/idempiere/rest/api/model/MRestWebhookOutLog.java
The file was addedcom.trekglobal.idempiere.rest.api.test/src/com/trekglobal/idempiere/rest/api/webhook/test/WebhookRetryPendingTest.java
The file was modifiedcom.trekglobal.idempiere.rest.api/src/com/trekglobal/idempiere/rest/api/process/WebhookRetryProcessor.java