tkuester / taky

A simple python TAK server
MIT License
188 stars 43 forks source link

Two clients sharing the same UID will fight over logfiles #10

Closed tkuester closed 2 years ago

tkuester commented 3 years ago

If two clients connect with the same UID, they will both try to write to the same log file. This can happen when one client disconnects from WiFi, and switches over to LTE.

One idea is that the router should separate socket clients from TAKUsers, and a TAKUser should become a singleton object--but this seems cumbersome, and means the TAKUsers need to count references. Another idea is using the IP address in the logfile name with a timestamp -- but this does not guarantee uniqueness.

tkuester commented 3 years ago

So technically this is acceptable behavior with Python. This still should be addressed, but I'm removing the bug tag.

pinztrek commented 2 years ago

Just an opinion, but I do not see this as the server codes problem. If someone has duplicated uuids they are breaking the concept of a uuid which should be unique. If it's not unique then anomalous behavior would be expected. Reasonable uniqueness is the whole intent of a uuid and there are many ways to ensure they are probably unique. (Base on Mac address, etc)

tkuester commented 2 years ago

Correct -- there should never be two clients with the same UUID. However, I could see that happening by accident. For example, someone accidentally has their client script connect twice. Although the user should ensure this should never happen, at the very least we should understand taky's behavior. In this case, the behavior seems reasonable, but still a touch funny from a software perspective.