Skip to content

Client creation is not threadsafe #121

Open

Description

@robbavey

The construction of the Manticore Http Client is not threadsafe - the client is not constructed until first used in the multi_receive method, where it makes a call to the client method in the http client mixin.

With some debug logging adding, we can see:

[2021-04-30T17:20:38,734][[main]>worker0][INFO ][logstash.outputs.http    ][main][http_out] created #<Manticore::Client:0x4eb5309d>
[2021-04-30T17:20:38,734][[main]>worker3][INFO ][logstash.outputs.http    ][main][http_out] created #<Manticore::Client:0x165a8c91>
[2021-04-30T17:20:38,735][[main]>worker1][INFO ][logstash.outputs.http    ][main][http_out] created #<Manticore::Client:0x2d81234c>
[2021-04-30T17:20:38,735][[main]>worker2][INFO ][logstash.outputs.http    ][main][http_out] created #<Manticore::Client:0x3258927d>
[2021-04-30T17:20:40,853][[main]>worker1][INFO ][logstash.outputs.http    ][main][http_out] Used #<Manticore::Client:0x3258927d> to send request
[2021-04-30T17:20:40,853][[main]>worker3][INFO ][logstash.outputs.http    ][main][http_out] Used #<Manticore::Client:0x3258927d> to send request
[2021-04-30T17:20:40,854][[main]>worker2][INFO ][logstash.outputs.http    ][main][http_out] Used #<Manticore::Client:0x3258927d> to send request
[2021-04-30T17:20:40,854][[main]>worker0][INFO ][logstash.outputs.http    ][main][http_out] Used #<Manticore::Client:0x3258927d> to send request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions