mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-19 16:15:07 +00:00
test: cluster: fix syslog listener datagram ordering race
UnixSockerListener used ThreadingUnixDatagramServer, which spawns a new thread per datagram. The notification barrier in get_lines() relies on all prior datagrams being handled before the notification. With threading, the notification handler can win the lock before an audit entry handler, so get_lines() returns before the entry is appended. clear_audit_logs() then clears an incomplete buffer, and the late entry leaks into the next test's before/after diff. Switch to sequential UnixDatagramServer. The server thread now handles datagrams in kernel FIFO order, so the notification is always processed after all preceding audit entries. Refs SCYLLADB-1277
This commit is contained in:
@@ -345,7 +345,7 @@ class UnixSockerListener:
|
||||
elif data != "Initializing syslog audit backend.":
|
||||
self.server.parent_instance.lines.append(data)
|
||||
|
||||
class UnixDatagramServer(socketserver.ThreadingUnixDatagramServer):
|
||||
class UnixDatagramServer(socketserver.UnixDatagramServer):
|
||||
def __init__(self, socket_path, handler, parent_instance, lock):
|
||||
self.parent_instance = parent_instance
|
||||
self.mutex = lock
|
||||
|
||||
Reference in New Issue
Block a user