bsc icon indicating copy to clipboard operation
bsc copied to clipboard

WebSocket connection is systematically terminated. Starting from version 1.1.12

Open jsdavid opened this issue 1 year ago • 2 comments

System information

Geth version: v1.1.14 OS & Version: Debian-1011-buster-64-minimal

Expected behaviour

WebSocket connection should never drop. In version v1.1.11, the connection never dropped. I've been seeing this issue for a long time now. Please pay attention to this.

Actual behaviour

Starting from version v1.1.12, the WebSocket connection is systematically terminated

Steps to reproduce the behaviour

Run the following code through PM2 (preferably multiple processes), and watch the uptime. The connection may not break immediately, but after a long time.

import { ethers } from 'ethers'

const provider = new ethers.providers.WebSocketProvider('')
provider._websocket.once('open', () => console.log('Connection opened'))
provider._websocket.once('close', () => {
  console.log('Connection closed')
  setTimeout(() => process.exit(1), 0)
})

I'll attach a skin where 4 processes were launched at the same time. But in some processes, the connection was broken several times. (look at the uptime)

jsdavid avatar Oct 04 '22 01:10 jsdavid

its also happening in ipc too

haliliceylan avatar Oct 05 '22 09:10 haliliceylan

thanks, the team will dig into this issue

j75689 avatar Oct 12 '22 01:10 j75689