Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logs to Teams connection flow #2914

Merged
merged 6 commits into from
Jan 23, 2025
Merged

Conversation

hugobarauna
Copy link
Member

Closes #2910

Copy link

github-actions bot commented Jan 22, 2025

Uffizzi Preview deployment-60178 was deleted.

@@ -67,9 +71,11 @@ defmodule Livebook.Teams.Connection do
case WebSocket.send(data.http_conn, data.websocket, data.ref, :ping) do
{:ok, conn, websocket} ->
Process.send_after(self(), {:loop_ping, data.ref}, @loop_ping_delay)
Logger.warning("Teams WebSocket connection - ping with success")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was in doubt about logging here, but though it was worth it. The reason is that if a specfic process up in this process supervision tree dies, the Livebook.HubsSupervisor, this is not being restarted and could not see anything in log.

But, if we log here, we'll know if that process died and it was not restarted, if there are no "PING" logs anymore.

Open to suggestions, though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging a warning every 5 seconds sounds like too much, this may confuse other users that run without problems. Perhaps we should make these info and then we can ask users to set log level to info if we want to debug more precisely?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we can remove this one and use the absence of logging as an indication of success. We also don't want to fill the user disk with ping reports. :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this one and use the absence of logging as an indication of success.

@josevalim

I thought this way too.

One problem is that when Livebook.HubsSupervisor, no message is logged, the system gets not recovered to a working state, and the absence of logging continues... but the system is not working properly.

Any comments/suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hugobarauna I understand but we have no indication right now that pinging is the part that is absent, and we risk making this too verbose.

@hugobarauna hugobarauna requested a review from aleDsz January 22, 2025 19:58
@hugobarauna
Copy link
Member Author

@josevalim @jonatanklosko ready to merge?

@hugobarauna hugobarauna merged commit a3b3cc7 into main Jan 23, 2025
7 checks passed
@hugobarauna hugobarauna deleted the hb-teams-connection-logs branch January 23, 2025 14:14
hugobarauna added a commit that referenced this pull request Jan 23, 2025
jonatanklosko pushed a commit that referenced this pull request Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log more messages when app server loses/retries connection to Teams
4 participants