Skip to content

Commit 68d6c6b

Browse files
authored
Remove excessive sync message logging (#172)
Remove info-level logs for SS1, SS2, and SyncUpdate messages that flood the logs without providing actionable information. These messages occur frequently during normal collaboration and make it difficult to find relevant log entries. Kept error logging for debugging issues.
1 parent 1601e5f commit 68d6c6b

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

jupyter_server_documents/rooms/yroom.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -526,17 +526,11 @@ def handle_message(self, client_id: str, message: bytes) -> None:
526526
self.log.debug(f"Handled AwarenessUpdate from '{client_id}' for room '{self.room_id}'.")
527527
# Handle Sync messages
528528
elif sync_message_subtype == YSyncMessageSubtype.SYNC_STEP1:
529-
self.log.info(f"Received SS1 from '{client_id}' for room '{self.room_id}'.")
530529
self.handle_sync_step1(client_id, message)
531-
self.log.info(f"Handled SS1 from '{client_id}' for room '{self.room_id}'.")
532530
elif sync_message_subtype == YSyncMessageSubtype.SYNC_STEP2:
533-
self.log.info(f"Received SS2 from '{client_id}' for room '{self.room_id}'.")
534531
self.handle_sync_step2(client_id, message)
535-
self.log.info(f"Handled SS2 from '{client_id}' for room '{self.room_id}'.")
536532
elif sync_message_subtype == YSyncMessageSubtype.SYNC_UPDATE:
537-
self.log.info(f"Received SyncUpdate from '{client_id} for room '{self.room_id}''.")
538533
self.handle_sync_update(client_id, message)
539-
self.log.info(f"Handled SyncUpdate from '{client_id} for room '{self.room_id}''.")
540534

541535

542536
def handle_sync_step1(self, client_id: str, message: bytes) -> None:
@@ -570,23 +564,21 @@ def handle_sync_step1(self, client_id: str, message: bytes) -> None:
570564
# TODO: remove the assert once websocket is made required
571565
assert isinstance(new_client.websocket, WebSocketHandler)
572566
new_client.websocket.write_message(sync_step2_message, binary=True)
573-
self.log.info(f"Sent SS2 reply to client '{client_id}'.")
574567
except Exception as e:
575568
self.log.error(
576569
"An exception occurred when writing the SyncStep2 reply "
577570
f"to new client '{new_client.id}':"
578571
)
579572
self.log.exception(e)
580573
return
581-
574+
582575
self.clients.mark_synced(client_id)
583576

584577
# Send SyncStep1 message
585578
try:
586579
assert isinstance(new_client.websocket, WebSocketHandler)
587580
sync_step1_message = pycrdt.create_sync_message(self._ydoc)
588581
new_client.websocket.write_message(sync_step1_message, binary=True)
589-
self.log.info(f"Sent SS1 message to client '{client_id}'.")
590582
except Exception as e:
591583
self.log.error(
592584
"An exception occurred when writing a SyncStep1 message "
@@ -777,11 +769,6 @@ def _broadcast_message(self, message: bytes, message_type: Literal['AwarenessUpd
777769
if not client_count:
778770
return
779771

780-
if message_type == "SyncUpdate":
781-
self.log.info(
782-
f"Broadcasting {message_type} to all {client_count} synced clients."
783-
)
784-
785772
for client in clients:
786773
try:
787774
# TODO: remove this assertion once websocket is made required
@@ -795,11 +782,6 @@ def _broadcast_message(self, message: bytes, message_type: Literal['AwarenessUpd
795782
)
796783
self.log.exception(e)
797784
continue
798-
799-
if message_type == "SyncUpdate":
800-
self.log.info(
801-
f"Broadcast of {message_type} complete for room {self.room_id}."
802-
)
803785

804786
def _on_awareness_update(self, type: str, changes: tuple[dict[str, Any], Any]) -> None:
805787
"""

0 commit comments

Comments
 (0)