-
Notifications
You must be signed in to change notification settings - Fork 35
Description
If I have 2 threads try to create a channel simultaneously, sometimes one of them will get back a 409.
It's been easiest to cause in Java, but here's the error, and following that a simple bash script that caused it to happen once every few runs.
< HTTP/1.1 409 Conflict
< Date: Tue, 13 Mar 2018 17:31:21 GMT
< Content-Type: application/json
- Server Hub/2018.01.09.389.master is not blacklisted
< Server: Hub/2018.01.09.389.master
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: origin, content-type, accept, authorization
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
<
{ [data not shown]
100 121 0 48 100 73 201 305 --:--:-- --:--:-- --:--:-- 306
- Connection #0 to host hub.iad.staging.flightstats.io left intact
{"error": "Channel name crktest already exists"}*
#!/usr/bin/env bash
set -x
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
curl -v -X PUT --header "Content-Type: application/json" --data '{"owner":"foo", "name":"crktest", "description": "foobar", "ttlDays":"1"}' "http://hub.iad.staging.flightstats.io/channel/crktest" >> foo.txt 2>&1 &
sleep 10