Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`active_request_count` gauge doesn't decrease on WebSocket disconnect

Aperta
#671 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

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
30/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
scala

Direzione di ricerca

Inizia riproducendo una connessione WebSocket seguita da una disconnessione lato client, quindi ispeziona il ciclo di vita in SelectorLoop.scala e Http1ServerStage.scala, indicati negli stack trace. Traccia come viene aggiornata la metrica active_request_count e verifica che diminuisca dopo la disconnessione; controlla inoltre se le eccezioni di shutdown segnalate sono correlate.

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

Descrizione

bug module:blaze-server

I just made use of epimetheus-http4s metrics, which look to do almost the same as http4s' metricsOps, and noticed, that active_request_count never goes down for WebSocket connections.

I am using http4s - 0.20.0 and epimetheus-http4s - 0.2.0...

Not sure if it is related, but I get the following exceptions at server shutdown.
If WebSocket connection was opened, then at shutdown time:

2019-05-02 22:10:20,981 ERROR [blaze-selector-1][org.http4s.blaze.channel.nio1.NIO1HeadStage] ip: s: c: p: g: t: - Abnormal NIO1HeadStage termination
java.nio.channels.ShutdownChannelGroupException: null
	at org.http4s.blaze.channel.nio1.SelectorLoop.killSelector(SelectorLoop.scala:225)
	at org.http4s.blaze.channel.nio1.SelectorLoop.org$http4s$blaze$channel$nio1$SelectorLoop$$runLoop(SelectorLoop.scala:185)
	at org.http4s.blaze.channel.nio1.SelectorLoop$$anon$1.run(SelectorLoop.scala:67)
	at java.base/java.lang.Thread.run(Thread.java:835)

If WebSocket was opened and then closed by client-side, at server shutdown there are:

2019-05-02 22:12:04,365 ERROR [blaze-selector-1][org.http4s.blaze.channel.nio1.NIO1HeadStage] ip: s: c: p: g: t: - Abnormal NIO1HeadStage termination
java.nio.channels.ShutdownChannelGroupException: null
	at org.http4s.blaze.channel.nio1.SelectorLoop.killSelector(SelectorLoop.scala:225)
	at org.http4s.blaze.channel.nio1.SelectorLoop.org$http4s$blaze$channel$nio1$SelectorLoop$$runLoop(SelectorLoop.scala:185)
	at org.http4s.blaze.channel.nio1.SelectorLoop$$anon$1.run(SelectorLoop.scala:67)
	at java.base/java.lang.Thread.run(Thread.java:835)
2019-05-02 22:12:04,365 ERROR [blaze-selector-1][org.http4s.server.blaze.Http1ServerStage$$anon$1] ip: s: c: p: g: t: - Fatal Error: Error in requestLoop()
java.nio.channels.ShutdownChannelGroupException: null
	at org.http4s.blaze.channel.nio1.SelectorLoop.killSelector(SelectorLoop.scala:225)
	at org.http4s.blaze.channel.nio1.SelectorLoop.org$http4s$blaze$channel$nio1$SelectorLoop$$runLoop(SelectorLoop.scala:185)
	at org.http4s.blaze.channel.nio1.SelectorLoop$$anon$1.run(SelectorLoop.scala:67)
	at java.base/java.lang.Thread.run(Thread.java:835)
2019-05-02 22:12:04,364 ERROR [blaze-selector-4][org.http4s.blaze.channel.nio1.NIO1HeadStage] ip: s: c: p: g: t: - Abnormal NIO1HeadStage termination
java.nio.channels.ShutdownChannelGroupException: null
	at org.http4s.blaze.channel.nio1.SelectorLoop.killSelector(SelectorLoop.scala:225)
	at org.http4s.blaze.channel.nio1.SelectorLoop.org$http4s$blaze$channel$nio1$SelectorLoop$$runLoop(SelectorLoop.scala:185)
	at org.http4s.blaze.channel.nio1.SelectorLoop$$anon$1.run(SelectorLoop.scala:67)
	at java.base/java.lang.Thread.run(Thread.java:835)
2019-05-02 22:12:04,365 ERROR [blaze-selector-4][org.http4s.server.blaze.Http1ServerStage$$anon$1] ip: s: c: p: g: t: - Fatal Error: Error in requestLoop()
java.nio.channels.ShutdownChannelGroupException: null
	at org.http4s.blaze.channel.nio1.SelectorLoop.killSelector(SelectorLoop.scala:225)
	at org.http4s.blaze.channel.nio1.SelectorLoop.org$http4s$blaze$channel$nio1$SelectorLoop$$runLoop(SelectorLoop.scala:185)
	at org.http4s.blaze.channel.nio1.SelectorLoop$$anon$1.run(SelectorLoop.scala:67)
	at java.base/java.lang.Thread.run(Thread.java:835)
2019-05-02 22:12:04,365 ERROR [blaze-selector-1][org.http4s.blaze.channel.nio1.NIO1HeadStage] ip: s: c: p: g: t: - Abnormal NIO1HeadStage termination
java.nio.channels.ShutdownChannelGroupException: null
	at org.http4s.blaze.channel.nio1.SelectorLoop.killSelector(SelectorLoop.scala:225)
	at org.http4s.blaze.channel.nio1.SelectorLoop.org$http4s$blaze$channel$nio1$SelectorLoop$$runLoop(SelectorLoop.scala:185)
	at org.http4s.blaze.channel.nio1.SelectorLoop$$anon$1.run(SelectorLoop.scala:67)
	at java.base/java.lang.Thread.run(Thread.java:835)
2019-05-02 22:12:04,365 ERROR [blaze-selector-4][org.http4s.blaze.channel.nio1.NIO1HeadStage] ip: s: c: p: g: t: - Abnormal NIO1HeadStage termination
java.nio.channels.ShutdownChannelGroupException: null
	at org.http4s.blaze.channel.nio1.SelectorLoop.killSelector(SelectorLoop.scala:225)
	at org.http4s.blaze.channel.nio1.SelectorLoop.org$http4s$blaze$channel$nio1$SelectorLoop$$runLoop(SelectorLoop.scala:185)
	at org.http4s.blaze.channel.nio1.SelectorLoop$$anon$1.run(SelectorLoop.scala:67)
	at java.base/java.lang.Thread.run(Thread.java:835)
Lingua principale
Scala
Stelle
371
Fork
63
Merge medio
1g 18h
PR unite (30g)
8

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 http4s/blaze

Tutte le issue di http4s/blaze

Issue simili

Altre issue su Scala

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.