m-lab / uuid-annotator

Produces metadata locally for every connection on each server.
Apache License 2.0
0 stars 0 forks source link

Data race and socket binding #34

Closed pboothe closed 4 years ago

pboothe commented 4 years ago

There's a data race in main() where it is possible for the annotation socket to be created and then for everything else to crash. Subsequent runs will find that the annotation socket already exists and be unable to make it.

We should either fix the race or make the daemon delete the specified socket filename if it already exists.

stephen-soltesz commented 4 years ago

If a client opens the dangling socket for reading, blocks, and a second uuid-annotator removes it, will the first client exit?

For regular files, the open fd is still valid if a file is removed after open. I'm not sure what would happen for sockets. If the first client does not exit, then that would be a harder to debug problem. Or, perhaps the client should timeout?

stephen-soltesz commented 4 years ago

Discovered during oncall https://github.com/m-lab/dev-tracker/issues/580