Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simultaneous channel creates can cause a 409 #1036

Open
chriskessel opened this issue Mar 13, 2018 · 0 comments
Open

Simultaneous channel creates can cause a 409 #1036

chriskessel opened this issue Mar 13, 2018 · 0 comments

Comments

@chriskessel
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant