Closed stratoukos closed 8 years ago
Yes, that fix sounds good to me, and we should stick a nice validation check on the name length too.
I'm not sure how would we validate that, since every system has different max sizes. After a bit of testing I got these max values:
We could maintain a list of hardcoded values, but this sounds like a bad idea.
Posix-ipc already raises ValueError: The name is too long
for these cases, so the error is not that bad.
Ah, if the error is that clear then I think it's fine.
Asgi_ipc uses
"/%s-channel-dict"
for the shared memory segment name and"/%s-channel-dict-semaphore"
(where %s is the configured prefix).Mac OS X's IPC name sizes cannot be more than 30 bytes (source, second list item). This means that the maximum usable prefix on OS X is 6 characters, which is pretty small.
One solution would be to change the suffixes to something smaller (like "-chan" and "-chan-sem"). I can provide a PR if this solution is ok.
Thanks.