Skip to content

Commit ebe1fe4

Browse files
committed
fix: synchronize ConsentDao.create() to prevent random failures
ConsentDao.create() was the only method not marked synchronized, while read(), update(), and delete() all were. This allowed concurrent unsynchronized puts into the backing LinkedHashMap, corrupting its internal structure and causing recently created consents to silently become unreachable. This hopefully fixes instances where OIDF certification team saw this error after a while: { "error":"invalid_request", "error_description":"There is no consent corresponding to the consent ID 'urn:example:966a3535-dee0-4d3e-aff2-a8085653e8a1'." } which could be resolved by restarting java-oauth-server.
1 parent 14e41cf commit ebe1fe4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/com/authlete/jaxrs/server/obb/database/ConsentDao.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private String generateConsentId()
5858
}
5959

6060

61-
public Consent create(CreateConsent createConsent, long clientId)
61+
public synchronized Consent create(CreateConsent createConsent, long clientId)
6262
{
6363
CreateConsentData data = createConsent.getData();
6464
String consentId = generateConsentId();

0 commit comments

Comments
 (0)