This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
poetry install
over a running instance causes processes to segfault #15461
Closed
Description
When we looking into this, we saw that poetry install
is "editing" the shared object file rather than replacing it.
3510767 stat("/home/erikj/synapse/target/debug/libsynapse.so", {st_mode=S_IFREG|0755, st_size=35088552, ...}) = 0
3510767 stat("/home/erikj/synapse/synapse/synapse_rust.abi3.so", {st_mode=S_IFREG|0755, st_size=35088552, ...}) = 0
3510767 stat("/home/erikj/synapse/target/debug/libsynapse.so", {st_mode=S_IFREG|0755, st_size=35088552, ...}) = 0
3510767 stat("/home/erikj/synapse/synapse/synapse_rust.abi3.so", {st_mode=S_IFREG|0755, st_size=35088552, ...}) = 0
3510767 openat(AT_FDCWD, "/home/erikj/synapse/target/debug/libsynapse.so", O_RDONLY|O_CLOEXEC) = 3
3510767 fstat(3, {st_mode=S_IFREG|0755, st_size=35088552, ...}) = 0
3510767 ioctl(3, TCGETS, 0x7ffd23d7be30) = -1 ENOTTY (Inappropriate ioctl for device)
3510767 lseek(3, 0, SEEK_CUR) = 0
3510767 openat(AT_FDCWD, "/home/erikj/synapse/synapse/synapse_rust.abi3.so", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 4
3510767 fstat(4, {st_mode=S_IFREG|0755, st_size=0, ...}) = 0
3510767 ioctl(4, TCGETS, 0x7ffd23d7be30) = -1 ENOTTY (Inappropriate ioctl for device)
3510767 lseek(4, 0, SEEK_CUR) = 0
3510767 fstat(3, {st_mode=S_IFREG|0755, st_size=35088552, ...}) = 0
3510767 sendfile(4, 3, [0] => [35088552], 35088552) = 35088552
3510767 sendfile(4, 3, [35088552], 35088552) = 0
3510767 close(4) = 0
3510767 close(3) = 0
3510767 stat("/home/erikj/synapse/synapse/synapse_rust.abi3.so", {st_mode=S_IFREG|0755, st_size=35088552, ...}) = 0
3510767 chmod("/home/erikj/synapse/synapse/synapse_rust.abi3.so", 0100755) = 0
Erik investigated further and ultimately submitted a patch to setuptools-rust: PyO3/setuptools-rust#295. This was accepted, but has yet to be released.
Once a newer setuptools-rust release is available, we should take advantage of this to ensure that we don't accidentally segfault running processes when we actually want to do a rolling restart.
At the moment, setuptools_rust is currently upper-bounded at the current release version:
Lines 366 to 371 in ae69d69
which will presumably need bumping; confusingly we also have a lower bound here:
Lines 212 to 220 in ae69d69