Skip to content

[bug] NextReader() panic #657

Closed
Closed
@calbot

Description

@calbot

in conn.go NextReader...

	c.readErrCount++
	if c.readErrCount >= 1000 {
		panic("repeated read on failed websocket connection")
	}

This shouldn't panic if a timeout on read happens because I expect this. I would think readErrCount would reset if a subsequent successful read was completed. But that doesn't fix the problem in general since there could still be a string of timeouts over 1000.

I don't think you should panic or increment the readErrCount if the error was a timeout. I don't know if I like the panic here in general. Perhaps this panic could be optionally disabled on by setting a flag on the connection.

I'm trying to use gorrilla for a load test and using SetReadDeadline to test multiple connections in a loop (rather than go routines per connection which isn't scaleable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions