-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
I encountered a strange error whenever my payloads grew too large (150kb or more).
Whenever I would make request against our Python server, it would error with
ERROR: LoadError: gRPCServiceCallException: 12
but only on the very first run of the skript. In a REPL, the second request would usually work as expected.
I guess it is due to some timeout and I could overcome it by changing the send_data method in "curl.jl"
What I have finally come up with in my fork is this
function send_data(easy::Curl.Easy, input::Channel{T}, max_send_message_length::Int) where T <: ProtoType
for input_obj in input
input_buf = to_delimited_message_buffer( input_obj, max_send_message_length )
Downloads.upload_data( easy, input_buf )
# `upload_data` is missing the `yield()` statement
# but if I put it there, something errors
end
return nothing
end
function to_delimited_message_buffer(msg, max_message_length::Int)
iob = IOBuffer()
limitiob = LimitIO(iob, max_message_length)
write(limitiob, UInt8(0)) # compression
write(limitiob, hton(UInt32(0))) # message length (placeholder)
data_len = writeproto(limitiob, msg) # message bytes
seek(iob, 1) # seek out the message length placeholder
write(iob, hton(UInt32(data_len))) # fill the message length
seek(iob, 0)
return iob
endI don't really know if this rewritten version of send_data suits all possible use-cases. I only use a blocking client and there it seems to do well enough.
Metadata
Metadata
Assignees
Labels
No labels