Closed proofit404 closed 7 years ago
I had another report of it working "very slowly" inside Docker this week as well, to the point where I suspect it was not actually working - it's possible something about the IPC communication does not agree with Docker? Based on your error, it looks like the shared memory is not working correctly, but I don't really know how to proceed.
Hm. Maybe try changing the pickle format and see if that affects it?
But in the traceback above load
is called before dump
. So if I understand correctly pickle
tries to read from uninitialized memory and fails. We can set errors
mode into a different mode or tries to flush layer memory on first UnpickleError
.
Ah, it tries to unpickle it and then fails out at EOFError
if it's empty - it seems in this case the memory is zeroed but has a length, so it probably just needs to check if it's empty as well.
Sorry, I can't find the way to check if memory map or shared memory is empty.
Well all pickles start with an 0x80 opcode, so checking if the first byte of the mmap is 0x00 should be enough.
If this build will be successful with this fix, I'll do PR.
Yep, looks like problem solved.
Great! Closing this then.
This is a really weird situation.
I hit this thing while trying to fix
asgi_rabbitmq
build. This is what I've got when I try to use IPC layer inside Docker container.As you can see,
send
will be successful only after first use offlush
. I can't reproduce this behavior outside of Docker container. It works fine on my machine. But Travis builds use Docker for the build, so exactly same error happens in the CI.https://travis-ci.org/proofit404/asgi_rabbitmq/jobs/236879296#L4355-L4356
It is curious because
asgi_ipc
andasgi_redis
builds passed without any trouble.Any suggestions for future research?