Skip to content

Commit 25caea7

Browse files
committed
store: Log more details about notifications
1 parent e734af7 commit 25caea7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

store/postgres/src/notification_listener.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ impl NotificationListener {
222222
// longer than 500ms for new notifications to arrive,
223223
// but limit the size of each batch to 128 to guarantee
224224
// progress on a busy system
225+
if store_events {
226+
debug!(logger, "Waiting for store event"; "queue_size" => queue_size);
227+
}
225228
let notifications: Vec<_> = conn
226229
.notifications()
227230
.timeout_iter(Duration::from_millis(500))
@@ -243,7 +246,9 @@ impl NotificationListener {
243246
})
244247
.filter(|notification| notification.channel() == channel_name.0)
245248
.collect();
246-
249+
if store_events {
250+
debug!(logger, "Received store events"; "num_events" => notifications.len(), "queue_size" => conn.notifications().len());
251+
}
247252
// Read notifications until there hasn't been one for 500ms
248253
for notification in notifications {
249254
// Terminate the thread if desired
@@ -254,6 +259,9 @@ impl NotificationListener {
254259
match JsonNotification::parse(&notification, &mut conn) {
255260
Ok(json_notification) => {
256261
let timeout = ENV_VARS.store.notification_broadcast_timeout;
262+
if store_events {
263+
debug!(logger, "Broadcasting store event"; "notification" => format!("{:?}", json_notification));
264+
}
257265
match graph::block_on(
258266
sender.send_timeout(json_notification, timeout),
259267
) {

0 commit comments

Comments
 (0)