jrconlin/pushgo

server doesn't repsond to '{}' empty bracket pings

Closed this issue · 9 comments

  1. run this test two times.
    i set this in the config.ini : client.min_ping_interval = 0s
    mozilla-services/simplepush_load$ loads-runner load_gen.TestLoad.test_ping -u 1
  2. test says hello, then pings, the closes socket

actual: first time, the test runs quickly, second time, the server doesn't recognize that socket has been closed by client.

here's what the server looks like:

2013/09/17 18:19:49 [3]   main: New socket connection detected
2013/09/17 18:19:49 [3] worker: Socket receive {raw: {"messageType":"hello", "channelIDs":[], "uaid":"9f711357-33d1-4ede-a1c5-cdc1143eb0cb"}}
2013/09/17 18:19:49 [4] server: Handling HELLO event
2013/09/17 18:19:49 [3] server: handling 'hello' {uaid: 9f711357-33d1-4ede-a1c5-cdc1143eb0cb, channelIDs: }
2013/09/17 18:19:49 [4] server: Using existing UAID {uaid: 9f711357-33d1-4ede-a1c5-cdc1143eb0cb}
2013/09/17 18:19:49 [4] server: Proprietary Info {ip: , port: }
2013/09/17 18:19:49 [4]storage: SetUAIDHost {uaid: 9f711357-33d1-4ede-a1c5-cdc1143eb0cb, host: ec2-54-244-206-75.us-west-2.compute.amazonaws.com}
2013/09/17 18:19:49 [4] worker: sending response {cmd: hello, error: , uaid: 9f711357-33d1-4ede-a1c5-cdc1143eb0cb}
2013/09/17 18:19:49 [4]storage: Fetching items {uaid: n3ETVzPRTt6hxc3BFD6wyw==, items: []}
2013/09/17 18:19:49 [3]  timer: Client flush completed {duration: 1181595, uaid: 9f711357-33d1-4ede-a1c5-cdc1143eb0cb}
2013/09/17 18:19:50 [1] worker: Websocket Error {error: EOF}
2013/09/17 18:19:50 Stopping 9f711357-33d1-4ede-a1c5-cdc1143eb0cb 828035652ns...
2013/09/17 18:19:50 [4] worker: Run has completed a shut-down
2013/09/17 18:19:50 [4]   main: Server for client shut-down
2013/09/17 18:19:50 [4] server: Cleanup
2013/09/17 18:19:50 [4] server: Cleaning up socket {uaid: 9f711357-33d1-4ede-a1c5-cdc1143eb0cb}
2013/09/17 18:19:50 [3]  timer: Socket connection terminated {uaid: 9f711357-33d1-4ede-a1c5-cdc1143eb0cb, duration: 828226913}
2013/09/17 18:19:52 [3]   main: New socket connection detected
2013/09/17 18:19:52 [3] worker: Socket receive {raw: {"messageType":"hello", "channelIDs":[], "uaid":"4728000e-1393-4f98-8683-870371d883f9"}}
2013/09/17 18:19:52 [4] server: Handling HELLO event
2013/09/17 18:19:52 [3] server: handling 'hello' {uaid: 4728000e-1393-4f98-8683-870371d883f9, channelIDs: }
2013/09/17 18:19:52 [4] server: Using existing UAID {uaid: 4728000e-1393-4f98-8683-870371d883f9}
2013/09/17 18:19:52 [4] server: Proprietary Info {ip: , port: }
2013/09/17 18:19:52 [4]storage: SetUAIDHost {uaid: 4728000e-1393-4f98-8683-870371d883f9, host: ec2-54-244-206-75.us-west-2.compute.amazonaws.com}
2013/09/17 18:19:52 [4] worker: sending response {cmd: hello, error: , uaid: 4728000e-1393-4f98-8683-870371d883f9}
2013/09/17 18:19:52 [4]storage: Fetching items {uaid: RygADhOTT5iGg4cDcdiD+Q==, items: []}
2013/09/17 18:19:52 [3]  timer: Client flush completed {duration: 1242680, uaid: 4728000e-1393-4f98-8683-870371d883f9}

eventually, the socket times out and server recognizes that the socket has closed.

this doesn't happen on localhost - only on aws: simplepush-qa-large

once the server fails to close the client socket - it will repro the behavior till server is restarted.

deleted previous comment - this affects all tests and blocks load testing as everything ends up timing out.

From debugging with Ryan, we figured out that "{}" isn't working:
https://wiki.mozilla.org/WebAPI/SimplePush/Protocol#UserAgent_-.3E_PushServer_4

however, sending {"messageType":"ping"} does work correctly.

This was a regression, I've pushed a patch to the dev branch.
8675e32

I've not pushed to master since we're still working on the other bugs.

fixed in 63b0d90

I'm still able to reproduce this issue. I changed {"messageType":"ping"} to {} and the server doesn't print that it received anything

Edwin@edog:~/github/edmoz$ python wsdump.py ws://localhost:8080
Press Ctrl+C to quit
> {"messageType": "hello", "uaid":"uaid", "channelIDs":["abc"]}
  < {"messageType":"hello","status":200,"uaid":"uaid"}
> {"messageType": "hello", "uaid":"uaid", "channelIDs":["abc"]}
  < {"messageType":"hello","status":200,"uaid":"uaid"}
> {}
> {}
> "{}"

Well, for one thing, "uaid" is no longer a valid UAID. If nothing else, I'm surprised that the server didn't drop the connection and will investigate why.

The UAID and ChannelIDS must be a valid hex based UUID. For texting purposes, I tend to use ones like "deadbeef000000000000000000000000" and "decafbad000000000000000000000000"

I will add the fix to the pending (0.6.1) release.

even if I do pass a valid uaid - {} isn't responding with {"messageType":"ping","status":200}