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 2 years 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

@alexlucaci can you take a look?

bnb-tw avatar May 19 '23 16:05 bnb-tw

Hello,

I am not able to replicate the issue, I am now running a local node and spawned 7 different instance of your node script that are connected to the node for 22 hours without any reconnects.

image

bnb-alexlucaci avatar May 26 '23 12:05 bnb-alexlucaci

this error no longer persists on my side.

haliliceylan avatar Jun 13 '23 13:06 haliliceylan

this error no longer persists on my side.

did you update to a newer version?

bnb-alexlucaci avatar Jun 14 '23 12:06 bnb-alexlucaci

closing, looks to be resolved

bnb-tw avatar Jul 05 '23 02:07 bnb-tw