Are position handlers thread-safe?

memesaregooda month ago

I keep getting into an issue when the device sends too many messages at once (e.g. from the black box) and Traccar doesn't seem to keep up. According to my logs, it processes one position from a device, and right after that another one, but it seems the handler uses the same last position in the handler at both times. Is multithreading somehow used in ProcessingHandler and how can I keep this issue from happening? Can I set up a 100ms delay between processing the next position from the same device?

Anton Tananaeva month ago

There should be no parallel processing for the same device. Why would you want a delay between processing?

As for using same last value, that would only happen if it's the last position by time.

memesaregooda month ago

By which time exactly? Server time?

Anton Tananaeva month ago

Traccar always uses the fix time.

memesaregooda month ago

How would Traccar choose the position if there are several positions with the same fix time?

Anton Tananaeva month ago

If the fix time is the same, they will be processed in the order they come.

memesaregooda month ago

Okay, but how will the last position be determined if there are several positions with the same fix time in the storage?