DPS: recover from a start/prepare whose response was lost

Aperta
#6,235 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java
Ambito
backend

Direzione di ricerca

Start with DataPlaneSignalingClient and DataPlaneSignalingFlowController in data-plane-signaling-core, and with DataPlaneSelectorService for data plane selection. The shared EdcHttpClient retry behaviour is the first cause to trace. Done means a lost start or prepare response is recovered by checking GET /dataflows/{id}/status, and the same data plane is reused on retry. This needs a design decision on the spec change before any code.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature_request stale triage

Which Areas Would Be Affected?

Data Plane Signaling in the control plane (data-plane-signaling-core): DataPlaneSignalingClient, DataPlaneSignalingFlowController, and possibly the data plane selection (DataPlaneSelectorService). Possibly a follow-up for the Data Plane Signaling specification.

Why Is the Feature Desired?

Since #6234, the transfer process state machine retries transient signaling failures (timeouts, I/O errors, 5xx), see #6177. One case is still not recoverable: the response to a start or prepare is lost (e.g. it times out) after the data plane has created the data flow.

  • The request is sent again for the same dataFlowId. First the HTTP client re-sends it: the runtime's shared EdcHttpClient retries any exception, including a read timeout after the request reached the data plane, within about 0.5 s. Then the state machine retries it after its backoff.
  • The data plane must reject a repeated request. The Data Plane Signaling specification requires a 4xx for an existing dataFlowId (e.g. 409 Data flow with id … already exists). The 4xx is final, so the transfer process is terminated even though its data flow exists.
  • The lost response can't be obtained again. GET /dataflows/{id}/status returns only dataFlowId and state. When a synchronous start succeeded but its response was lost, its data address can't be recovered. For PULL, that's the endpoint and token the consumer needs.
  • A retry may go to another data plane. Every attempt selects the data plane again (random strategy by default), and the data plane id is stored on the transfer process only after a successful response. With several data planes matching a transfer, a retry may create a second flow elsewhere and leave the first one orphaned.

This shows up with slow or overloaded data planes: #6177 observed it with siglet under load. The transfer is then terminated, while the data flow stays on the data plane.

Solution Proposal

These can be combined:

  1. No HTTP-level retry for signals. Send signals with a client that has no retry policy, so that only the state machine retries. That avoids the immediate re-send and doesn't block a worker during HTTP retries. It can be done within the signaling extension (its own EdcHttpClientImpl with a no-retry policy), or with a new EdcHttpClient method in the SPI.
  2. Check the status on a 4xx for start / prepare: call GET /dataflows/{id}/status.
    • No flow (404): the 4xx is genuine, fail.
    • PREPARING / STARTING: continue as an asynchronous flow, since the address arrives through the prepared / started callback.
    • PREPARED / STARTED: the response was lost. Terminate the flow on the data plane and fail with an explicit error.
  3. Keep the data plane across retries. Store the selected data plane id on the transfer process when a start / prepare fails with ERROR_RETRY, and send retries to that data plane (findById) instead of selecting again.
  4. Specification follow-up (Data Plane Signaling): make start / prepare idempotent, so that a repeated request for an existing dataFlowId with the same content returns the original response. That is the only way to recover a lost synchronous response.
Lingua principale
Java
Stelle
429
Fork
302
Merge medio
10h 46m
PR unite (30g)
75

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-edc/Connector

Tutte le issue di eclipse-edc/Connector

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.