Skip to content

Pluggable Networking Stacks #279

Closed
@brianmichel

Description

@brianmichel

When using Swift on Windows and Linux the built-in URLSession code has a pretty nasty bug which can result in a crash as outlined here, swiftlang/swift-corelibs-foundation#4791. Being able to plug in a networking stack, by perhaps implementing an interface and setting a value on the Segment SDK would be nice.

We will likely be taking on a version of this work since we need to use Segment on Windows, so I wanted to file this issue to see if this is something the maintainers would accept as as upstream patch perhaps.

Describe the solution you'd like
I'm imagining a protocol the describe the current HTTPClient and perhaps some types to mask over the URLSession*Task types that get stored in various places.

Describe alternatives you've considered

  1. Using Segment without patching the underlying Swift issue risks application crashes so it's an option, but is risky as it could result in a crash app.
  2. We could consider running all Segment code in a different process so that if it's networking code results in a crash it just takes down that process and doesn't kill our application. This is a little challenging since there isn't a standardized way to do this across Darwin, Linux, and Windows, but it's likely possible.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions