REST date key conversion shares a SimpleDateFormat across requests
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with DefaultKeyConverter in coherence-rest and compare its shared SimpleDateFormat usage with the synchronized usage in DateTimeAdapter. Reproduce the issue by calling toString and fromString concurrently on one converter. Done means concurrent conversions format and parse yyyy-MM-dd consistently without exceptions; pull request #159 is already open for this issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
DefaultKeyConverter shares one static SimpleDateFormat for REST date keys. fromString and toString use it from request threads with no lock. SimpleDateFormat is not thread-safe, so concurrent date-key conversion can return the wrong day or throw ArrayIndexOutOfBoundsException.
To Reproduce
Call toString and fromString on one DefaultKeyConverter(Date.class) from several threads at the same time.
Expected behaviour
Each call formats yyyy-MM-dd and parses that string back to the same date.
Environment
- Coherence CE main,
DefaultKeyConverterincoherence-rest - Any current Java runtime
Additional context
DateTimeAdapter already synchronizes its shared SimpleDateFormat. The REST converter should do the same.
- Lingua principale
- Java
- Stelle
- 475
- Fork
- 80
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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 oracle/coherence
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 54/100
-
URL reads have no connect or read timeoutForse già presa @SebTardif l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
-
CohQL snapshot names share a SimpleDateFormat across commandsForse già presa @SebTardif l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
-
Dynamic backupsAperta25.09 enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Allow auto scaling without making cluster vulnerableForse già presa @aseovic l’ha presa 9 giorni fa. Apertaenhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di oracle/coherence
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Run the CLI with JBangApertaenhancement XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
nikolas-charalambidis/facepalm-maven-plugin#237 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
dekobon/big-code-analysis#1913 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno