cloudevents / sdk-go

Go SDK for CloudEvents
https://cloudevents.github.io/sdk-go/
Apache License 2.0
811 stars 217 forks source link

Question: Only one usage of each socket address (protocol/network address/port) is normally permitted. #780

Open ghstahl opened 2 years ago

ghstahl commented 2 years ago

Windows 11:

I am doing a load test and am getting the following error: Only one usage of each socket address (protocol/network address/port) is normally permitted.

My naive implementation is taken right from your readme.md where I create a new client per request.

c, err := cloudevents_sdk_go.NewClient(p, cloudevents_sdk_go.WithTimeNow(),
        cloudevents_sdk_go.WithUUIDs(),
    )

I have tried to cache the http.Client and use.

    options = append(options, cloudevents_sdk_go_protocol_http.WithClient(*s.HttpClientContainer.Client))

where my client has a ptr to the transport.

I have tried caching the RoundTripper transport;

    options = append(options, cloudevents_sdk_go_protocol_http.WithRoundTripper(s.HttpClientContainer.RoundTripper))

Can you give me any advise that will not exhaust ports under a load test?

Thanks

n3wscott commented 2 years ago

@slinkydeveloper created the loadtest, maybe he can weigh in here?