hashrocket / websocket-shootout

A comparison of websocket servers in multiple languages and frameworks
MIT License
428 stars 76 forks source link

Error in actioncable benchmark #46

Closed lexasoft123 closed 7 years ago

lexasoft123 commented 7 years ago

System: FreeBSD 11.0 Go: go version go1.7.4 freebsd/amd64 Error:

./bin/websocket-bench broadcast ws://10.10.0.20:8888/ -l 10.10.0.21 -c 4 -s 100 --step-size 100 --origin http://10.10.0.20/ --server-type actioncable
panic: interface conversion: interface is nil, not string

goroutine 61 [running]:
panic(0x6db480, 0xc4201055c0)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
hashrocket/websocket-bench/benchmark.(*ActionCableServerAdapter).Receive(0xc42008a2f8, 0x0, 0x0, 0x0)
        /data/home/test/websocket-shootout/go/src/hashrocket/websocket-bench/benchmark/action_cable_server_adapter.go:79 +0x169
hashrocket/websocket-bench/benchmark.(*localClient).rx(0xc4202b62d0)
        /data/home/test/websocket-shootout/go/src/hashrocket/websocket-bench/benchmark/local_client.go:163 +0x49
created by hashrocket/websocket-bench/benchmark.newLocalClient
        /data/home/test/websocket-shootout/go/src/hashrocket/websocket-bench/benchmark/local_client.go:140 +0x5bd

I see such payload in Rails log:

I, [2017-01-21T12:52:16.513466 #1355]  INFO -- : BenchmarkChannel transmitting {"action"=>"broadcast", "payload"=>{"SendTime"=>"2017-01-21T12:52:17.131527137+01:00", "Padding"=>""}} (via streamed from all)
I, [2017-01-21T12:52:16.505506 #1355]  INFO -- : BenchmarkChannel transmitting {"action"=>"broadcast", "payload"=>{"SendTime"=>"2017-01-21T12:52:17.131527137+01:00", "Padding"=>""}} (via streamed from all)
I, [2017-01-21T12:52:16.513070 #1355]  INFO -- : BenchmarkChannel transmitting {"action"=>"broadcast", "payload"=>{"SendTime"=>"2017-01-21T12:52:17.131527137+01:00", "Padding"=>""}} (via streamed from all)
jackc commented 7 years ago

Thanks, a previous change to add a binary mode inadvertently broke the ActionCable adapter. Should work now.