Don't hold a DB connection during token validation of incoming negotiation and transfer messages
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 54/100
Direzione di ricerca
Start by reading ContractNegotiationProtocolServiceImpl and TransferProcessProtocolServiceImpl, then compare the catalog-request change in #6180. Trace each notify* method’s transaction, verification, lease, and save steps; done means verification runs outside the write transaction while the leased action still re-reads and checks state, with the JTI retry behavior and policy staleness considerations addressed.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Feature Request
Validate the counter-party's token of incoming DSP negotiation and transfer messages outside the transaction that
leases and updates the entity, as #6180 did for catalog requests.
Which Areas Would Be Affected?
control-plane-aggregate-services: ContractNegotiationProtocolServiceImpl, TransferProcessProtocolServiceImpl.
Why Is the Feature Desired?
Every notify* method runs inside one transactionContext.execute(...):
- read the negotiation or transfer (or the offer);
protocolTokenValidator.verify(...);- lease, apply the message, save.
Token validation makes remote calls: DID resolution, the DCP presentation request to the counter-party's credential
service, and STS signing. It also runs SQL before them (the entity read, the JTI replay check, participant config). So
the transaction's connection stays checked out, idle in transaction, for the whole remote round trip.
In a load test (40 negotiation+transfer flows/s), Postgres showed 27–37 connections idle in transaction against 1–9
active. A thread dump showed 21 request threads in DefaultCredentialServiceClient.sendRequest, under
LocalTransactionContext.execute (e.g. TransferProcessProtocolServiceImpl.notifyTerminated). The pool must
therefore be sized for the slowest credential service, not for the database work.
Solution Proposal
- Read what verification needs outside the write transaction, i.e. the entity, or the offer for
notifyRequested, to
get the policy whose scopes are requested. Each store call runs its own short transaction. - Call
verifyoutside any transaction. - Then
transactionContext.execute { findByIdAndLease + action + save }. The leased action already re-reads the
entity and checks its state.
Points to discuss:
- JTI replay entry: today a failure after validation (e.g.
409on a held lease) rolls back the JTI insert, so a
retry with the same token passes. With validation outside the transaction, the JTI entry is committed, and a retry
with the same token gets401. EDC builds a new token per dispatch, but the HTTP client's automatic retry re-sends
the same request (see the related signaling issue). - Policy staleness: the policy used for the scopes is read before the lease. It changes only through a later offer
message, which the state checks of the leased action reject anyway. - Participant config reads during validation no longer share the request's transaction cache (see the config
cache issue).
- Lingua principale
- Java
- Stelle
- 429
- Fork
- 302
- Merge medio
- 10h 46m
- PR unite (30g)
- 75
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di eclipse-edc/Connector
-
triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
eclipse-edc/Connector#6293 ·
I maintainer di solito rispondono entro 1 giorno
-
Implement conditional extension loading (DR 2026-11-24)Forse già presa @paullatzelsperger l’ha presa 5 giorni fa. Apertafeature_request triage
eclipse-edc/Connector#6275 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
feature_request stale triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
eclipse-edc/Connector#6235 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
feature_request triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
eclipse-edc/Connector#6182 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
feature_request triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
eclipse-edc/Connector#6178 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di eclipse-edc/Connector
Issue simili
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
eclipse-edc/IdentityHub#1296 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
cloudfoundry/uaa#4194 ·
I maintainer di solito rispondono entro 1 giorno
-
ui: 進捗状況線ダイアログが日本語表示で英語のままApertaarea: ui priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
tetsuji16/microProject#1721 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
The engine's "loaded, but had errors" message leaves out which library and line each error is inAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
cqframework/clinical_quality_language#1980 ·
I maintainer di solito rispondono entro 3 giorni