Skip to content

Commit

Permalink
Remove client support for pipelined requests (#783)
Browse files Browse the repository at this point in the history
* Remove client support for pipelined requests

Follows up on the discussion and work started in
#732.

The gist is this: supporting "pipelined requests" is not well-supported
across the web these days and severely complicates the threadsafe client
implementation in HTTP.jl. And as has been pointed out in various
discussions, the attempt to support pipelining is affecting our ability
to avoid thread-safety issues in general (see
#517).

This commit has a few key pieces:
  * Splits "connection pooling" logic into a new connectionpools.jl file
  * Removes pipeline-related fields/concepts from the ConnectionPool.jl
  file and specifically the `Connection`/`Transaction` data structures
  * Attempts to simplify a lot of the work/logic around managing a
  `Transaction`'s lifecycle

Things I haven't done yet:
  * Actually deprecated the `pipeline_limit` keyword argument
  * Got all tests passing; I think the websockets/server code isn't
  quite ironed out yet, but I'll dig into it some more tomorrow

Big thanks to @nickrobinson251 for help reviewing the connectionpools.jl
logic.

Pinging people to help review: @c42f, @vtjnash, @s2maki, @fredrikekre

* get more tests passing; remove Transaction

* Get all tests passing

* update Julai compat to 1.6

* fix 32-bit and docs

* fix 32-bit

* fix 32-bit

* Address review comments

* Added `GC.@preserve` annotations
* Removed calls to `hash` in `hashconn` and renamed to `connectionkey`
* Removed enforcement of `reuse_limit`
* Renamed some fields/variables for clarity
* Cleaned up comments for clarification in connectionpools.jl
* Added an additional `acquire` method that accepts an already created
connection object for `Pod` insertion/tracking
  • Loading branch information
quinnj authored Dec 14, 2021
1 parent 6b72d2d commit f3a3fb7
Show file tree
Hide file tree
Showing 17 changed files with 605 additions and 730 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.0'
- '1.6'
- '1' # automatically expands to the latest stable 1.x release of Julia
- 'nightly'
os:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
IniFile = "0.5"
MbedTLS = "0.6.8, 0.7, 1"
URIs = "1.3"
julia = "0.7, 1"
julia = "1.6"

[extras]
BufferedStreams = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d"
Expand Down
11 changes: 5 additions & 6 deletions docs/src/internal_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ HTTP.Streams.isaborted

```@docs
HTTP.ConnectionPool.Connection
HTTP.ConnectionPool.Transaction
HTTP.ConnectionPool.getconnection
HTTP.ConnectionPool.newconnection
HTTP.ConnectionPool.POOL
HTTP.IOExtras.startwrite(::HTTP.ConnectionPool.Transaction)
HTTP.IOExtras.closewrite(::HTTP.ConnectionPool.Transaction)
HTTP.IOExtras.startread(::HTTP.ConnectionPool.Transaction)
HTTP.IOExtras.closeread(::HTTP.ConnectionPool.Transaction)
HTTP.IOExtras.startwrite(::HTTP.ConnectionPool.Connection)
HTTP.IOExtras.closewrite(::HTTP.ConnectionPool.Connection)
HTTP.IOExtras.startread(::HTTP.ConnectionPool.Connection)
HTTP.IOExtras.closeread(::HTTP.ConnectionPool.Connection)
```
Loading

0 comments on commit f3a3fb7

Please sign in to comment.