From a6f74e88e6b5116d8cc79b83d8645d6e25f09591 Mon Sep 17 00:00:00 2001 From: samkaplan Date: Mon, 11 Mar 2024 13:47:12 +0000 Subject: [PATCH] Do not migrate tasks to a different thread pool --- Project.toml | 4 ++-- src/clientlayers/StreamRequest.jl | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 6645221c..de51fe64 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "HTTP" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" authors = ["Jacob Quinn", "contributors: https://github.com/JuliaWeb/HTTP.jl/graphs/contributors"] -version = "1.10.3" +version = "1.10.4" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" @@ -22,7 +22,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [compat] CodecZlib = "0.7" -ConcurrentUtilities = "2.2" +ConcurrentUtilities = "2.4" ExceptionUnwrapping = "0.1" LoggingExtras = "0.4.9,1" MbedTLS = "0.6.8, 0.7, 1" diff --git a/src/clientlayers/StreamRequest.jl b/src/clientlayers/StreamRequest.jl index c3bc7787..4f6e8a9c 100644 --- a/src/clientlayers/StreamRequest.jl +++ b/src/clientlayers/StreamRequest.jl @@ -3,6 +3,7 @@ module StreamRequest using ..IOExtras, ..Messages, ..Streams, ..Connections, ..Strings, ..RedirectRequest, ..Exceptions using LoggingExtras, CodecZlib, URIs using SimpleBufferStream: BufferStream +using ConcurrentUtilities: @samethreadpool_spawn export streamlayer @@ -36,7 +37,7 @@ function streamlayer(stream::Stream; iofunction=nothing, decompress::Union{Nothi # use a lock here for request.context changes (this is currently the only places # where multiple threads may modify/change context at the same time) lock = ReentrantLock() - Threads.@spawn try + @samethreadpool_spawn try writebody(stream, req, lock) finally Base.@lock lock begin @@ -46,7 +47,7 @@ function streamlayer(stream::Stream; iofunction=nothing, decompress::Union{Nothi closewrite(stream) end read_start = time() - Threads.@spawn try + @samethreadpool_spawn try @debugv 2 "client startread" startread(stream) if !isaborted(stream)