Skip to content

Simultaneous channel creates can cause a 409 #1036

@chriskessel

Description

@chriskessel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions