Closed ajelenak closed 2 years ago
I've put in a check here: https://github.com/HDFGroup/hsds/commit/f7d8f0cccf3379b50a0299f8bb48b84debff0808. It's unfortunate that tempfile package on MacOS returns such long directory names. Currently when a socket_dir is not specified hsds_app is using /tmp/hs1234abcd/ as the directory name where "1234abcd" is a random hex string.
It is funny there are still these limits from ye olde days of computing. 😁
Thanks!
Yes, something to do with max hostname length - see https://bugs.python.org/issue32958. Why this should matter when you are using sockets, I don't know.
When trying to run HSDS in the nodocker mode, socket directory paths above certain number of characters can break low-level socket communication code. I encountered this problem when setting up nodocker HSDS in a pytest fixture on a macOS computer. Temporary directories on macOS have long paths and prevent communication with HSDS if used as socket directories.
Two reported errors are:
AF_UNIX path too long
orUnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
. For the first error, the limit seems to be somewhere around 104-108 characters, while for the second 64 characters.I suggest that HSDS when started in nodocker mode warns or raises an exception if socket directory path is longer than 64 characters.