inhindsight / hindsight

Apache License 2.0
12 stars 8 forks source link

Receive cannot have more than one websocket dataset at a time #189

Open ManApart opened 4 years ago

ManApart commented 4 years ago

Description

Even when given different paths in the Accept struct, Receive cannot have multiple websocket definitions at once.

AC

Error/Reproduce

Error:

 12:07:05.200 [error] Failed to start Ranch listener Accept.Websocket.Router.HTTP in :ranch_tcp:listen([cacerts: :..., key: :..., cert: :..., port: 6790]) for reason :eaddrinuse (address already in use)
12:07:05.200 [warn] Elixir.Receive.SocketManager: Stopping : {:shutdown, {:failed_to_start_child, {:ranch_listener_sup, Accept.Websocket.Router.HTTP}, {:shutdown, {:failed_to_start_child, :ranch_acceptors_sup, {:listen_error, Accept.Websocket.Router.HTTP, :eaddrinuse}

Definitions / Store State:

[
  %Accept{
    connection: %Accept.Websocket{
      hibernate: false,
      idle_timeout: 1440000,
      path: "/small-payload-id",
      port: 6790,
      version: 1
    },
    dataset_id: "small-payload-push-datasetid",
    destination: "small-payload-receive",
    id: "small-payload-id",
    subset_id: "small-payload-subset",
    version: 1
  },
  %Accept{
    connection: %Accept.Websocket{
      hibernate: false,
      idle_timeout: 1440000,
      path: "/receive/ws",
      port: 6790,
      version: 1
    },
    dataset_id: "thicc-bois-generated-50x1-datasetid",
    destination: "thicc-bois-generated-50x1-receive",
    id: "thicc-bois-generated-50x1",
    subset_id: "thicc-bois-generated-50x1-subset",
    version: 1
  }
]