Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(vpn): send info, debug logs over tunnel#18240

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanndickson merged 2 commits intomainfromethan/send-more-logs-over-tunnel
Jun 6, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndicksonethanndickson commentedJun 5, 2025
edited
Loading

@ethanndicksonGraphite App
Copy link
MemberAuthor

ethanndickson commentedJun 5, 2025
edited
Loading

@@ -65,7 +65,6 @@ func (r *RootCmd) vpnDaemonRun() *serpent.Command {
logger.Info(ctx, "starting tunnel")
tunnel, err := vpn.NewTunnel(ctx, logger, pipe, vpn.NewClient(),
vpn.UseOSNetworkingStack(),
vpn.UseAsLogger(),
Copy link
MemberAuthor

@ethanndicksonethanndicksonJun 5, 2025
edited
Loading

Choose a reason for hiding this comment

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

The Windows app drops logs received over the tunnel, so this can be removed. It adds it's own sink tostderr.

Comment on lines +305 to +310
select {
case <-t.updater.ctx.Done():
return
case <-t.ctx.Done():
return
case t.sendCh <- msg:
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

We deliberately never cancel the tunnel ctx, due to the somewhat precarious teardown procedure. We do however cancel the updater ctx to ensure we don't tick network updates after shutdown, so we'll check for that here too.

Comment on lines -49 to -50
logMu sync.Mutex
logs []*TunnelMessage
Copy link
MemberAuthor

@ethanndicksonethanndicksonJun 5, 2025
edited
Loading

Choose a reason for hiding this comment

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

I'm not seeing any value in this buffer, as we don't do any disk I/O - the pipe is entirely in-memory. With pings every 5 seconds and debug logs on, we produce around 150~ logs a minute, or about 35 kilobytes. The in-memory pipe can handlegigabytes a second. I think buffering would make sense were we relaying the logs to a terminal or a file, but that's not the case here.

Since only Error and above logs are flushed immediately, the alternative is adding the complexity of flushing the logs from the buffer periodically. One downside of this is that the macOS timestamps on the logs once they reach the Swift code aren't actually representative of the time the log was produced.

@ethanndicksonethanndickson marked this pull request as ready for reviewJune 5, 2025 04:13
@ethanndicksonethanndicksonforce-pushed theethan/send-more-logs-over-tunnel branch fromc65ebb2 to8d8937dCompareJune 5, 2025 04:41
@ethanndicksonGraphite App
Copy link
MemberAuthor

ethanndickson commentedJun 6, 2025
edited
Loading

Merge activity

  • Jun 6, 4:18 AM UTC: A user started a stack merge that includes this pull request viaGraphite.
  • Jun 6, 4:20 AM UTC:Graphite rebased this pull request as part of a merge.
  • Jun 6, 4:31 AM UTC:@ethanndickson merged this pull request withGraphite.

@ethanndicksonethanndickson changed the base branch fromethan/send-ping-results tographite-base/18240June 6, 2025 04:18
@ethanndicksonethanndickson changed the base branch fromgraphite-base/18240 tomainJune 6, 2025 04:19
@ethanndicksonethanndicksonforce-pushed theethan/send-more-logs-over-tunnel branch fromc5c1ab5 to8535d64CompareJune 6, 2025 04:19
@ethanndickson
Copy link
MemberAuthor

ethanndickson commentedJun 6, 2025
edited
Loading

Review request can be ignored - graphite touched proto files for a moment doing it's branch switching + rebase (why?).

@ethanndicksonethanndickson merged commit628b81c intomainJun 6, 2025
35 checks passed
@ethanndicksonethanndickson deleted the ethan/send-more-logs-over-tunnel branchJune 6, 2025 04:31
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 6, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@deansheatherdeansheatherdeansheather approved these changes

@spikecurtisspikecurtisAwaiting requested review from spikecurtis

@johnstcnjohnstcnAwaiting requested review from johnstcn

Assignees

@ethanndicksonethanndickson

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

CoderVPN: Surface logs ofInfo level and lower
2 participants
@ethanndickson@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp