Cleanup metrics connections after idle timeout (#2748)

When the prometheus service restarts, connections can be left open and never closed. These connections should close after an idle timeout to avoid causing issues with running out of ports.

Signed-off-by: Paul Harris <paul.harris@consensys.net>
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
This commit is contained in:
Paul Harris
2021-09-10 12:45:16 +10:00
committed by GitHub
parent 61ae7b0384
commit 75324f3817
2 changed files with 3 additions and 1 deletions

View File

@@ -22,7 +22,8 @@
### Bug Fixes
- Consider effective price and effective priority fee in transaction replacement rules [\#2529](https://github.com/hyperledger/besu/issues/2529)
- GetTransactionCount should return the latest transaction count if it is greater than the transaction pool [\#2633](https://github.com/hyperledger/besu/pull/2633)
- GetTransactionCount should return the latest transaction count if it is greater than the transaction pool [\#2633](https://github.com/hyperledger/besu/pull/2633)
- Set an idle timeout for metrics connections, to clean up ports when no longer used [\#2748](https://github.com/hyperledger/besu/pull/2748)
### Early Access Features

View File

@@ -84,6 +84,7 @@ public class MetricsHttpService implements MetricsService {
new HttpServerOptions()
.setHost(config.getHost())
.setPort(config.getPort())
.setIdleTimeout(60)
.setHandle100ContinueAutomatically(true)
.setCompressionSupported(true));