ibapi icon indicating copy to clipboard operation
ibapi copied to clipboard

Infinite loop on client connection errors

Open mrosel opened this issue 3 years ago • 0 comments

Client gets stuck in an infinite loop when there are connection issues. The easiest way to reproduce this is by connecting to the api with the same connection id.

    err = ic.Connect(host, port, 0)
{"level":"info","ts":1616442356.7662585,"caller":"[email protected]/client.go:90","msg":"set wrapper","wrapper":{"AccountValues":null,"AccountPositions":null,"OpenOrders":null}}
{"level":"info","ts":1616442356.7665522,"caller":"[email protected]/client.go:290","msg":"reset ibClient"}
{"level":"info","ts":1616442356.766604,"caller":"[email protected]/client.go:79","msg":"connection state is changed","previous":0,"current":0}
{"level":"info","ts":1616442356.7666292,"caller":"[email protected]/client.go:79","msg":"connection state is changed","previous":0,"current":1}
{"level":"info","ts":1616442356.7697575,"caller":"[email protected]/client.go:181","msg":"try to handShake with TWS or GateWay"}
{"level":"info","ts":1616442356.769828,"caller":"[email protected]/client.go:200","msg":"handShake init..."}
{"level":"info","ts":1616442356.774035,"caller":"[email protected]/client.go:227","msg":"init info","serverVersion":157}
{"level":"info","ts":1616442356.7741022,"caller":"[email protected]/client.go:228","msg":"init info","connectionTime":"20210322 15:45:56 EST"}
{"level":"info","ts":1616442356.7742827,"caller":"[email protected]/client.go:2891","msg":"receiver start"}
{"level":"panic","ts":1616442357.3725574,"caller":"[email protected]/client.go:2927","msg":"scanner Error","stacktrace":"github.com/hadrianl/ibapi.(*IbClient).goReceive\n\t/user/go/pkg/mod/github.com/hadrianl/[email protected]/client.go:2927"}
{"level":"info","ts":1616442357.37279,"caller":"runtime/panic.go:969","msg":"receiver end"}
{"level":"error","ts":1616442357.3728147,"caller":"[email protected]/client.go:2895","msg":"receiver got unexpected error","error":"scanner Error","stacktrace":"github.com/hadrianl/ibapi.(*IbClient).goReceive.func1\n\t/user/go/pkg/mod/github.com/hadrianl/[email protected]/client.go:2895\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:969\ngo.uber.org/zap/zapcore.(*CheckedEntry).Write\n\t/user/go/pkg/mod/go.uber.org/[email protected]/zapcore/entry.go:234\ngo.uber.org/zap.(*Logger).Panic\n\t/user/go/pkg/mod/go.uber.org/[email protected]/logger.go:226\ngithub.com/hadrianl/ibapi.(*IbClient).goReceive\n\t/user/go/pkg/mod/github.com/hadrianl/[email protected]/client.go:2927"}
{"level":"info","ts":1616442357.3729947,"caller":"[email protected]/client.go:2898","msg":"try to restart receiver"}
{"level":"info","ts":1616442357.3730626,"caller":"[email protected]/client.go:2891","msg":"receiver start"}
{"level":"panic","ts":1616442357.3730989,"caller":"[email protected]/client.go:2927","msg":"scanner Error","stacktrace":"github.com/hadrianl/ibapi.(*IbClient).goReceive\n\t/user/go/pkg/mod/github.com/hadrianl/[email protected]/client.go:2927"}

mrosel avatar Mar 22 '21 20:03 mrosel