binder: ManagedClientTransport.Listener invocations are not properly synchronized
- Lingua principale
- Java
- Stelle
- 12.1k
- Fork
- 4k
- Merge medio
- 2g 17h
- PR unite (30g)
- 37
Descrizione
Impls of ManagedClientTransport.Listener "do not need to be thread-safe so notifications must be properly synchronized externally." BinderClientTransport mostly seems to achieve this by holding its "this" lock, except for `unregisterInbound()` which makes a naked call to `transportInUse(false)`.
The use of `AtomicInteger numInUseStreams` is questionable here too: an unregisterInbound() call could cause that counter to go to zero and that thread could decide to invoke `transportInUse(false)`. Before it can do so, a newStream() call could cause numInUseStreams to go positive and that thread could decide to call `transportInUse(true)`. These two threads would now race and if the `false` one wins, the Listener's idea of in use would become out of sync with reality.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia da BinderClientTransport, in particolare da unregisterInbound(), newStream(), numInUseStreams e transportInUse(...). Traccia i percorsi di notifica di ManagedClientTransport.Listener e verifica che la registrazione e la deregistrazione concorrenti degli stream non possano lasciare incoerente lo stato di utilizzo del listener.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- distributed-systems
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100