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

Pool DoT connections #105

Closed
ignoramous opened this issue Oct 19, 2024 · 1 comment
Closed

Pool DoT connections #105

ignoramous opened this issue Oct 19, 2024 · 1 comment
Assignees

Comments

@ignoramous ignoramous self-assigned this Oct 19, 2024
@ignoramous
Copy link
Contributor Author

ignoramous commented Oct 19, 2024

# with pooling (retrier only has one outgoing packet corresponding to one DNS query)
➜  firestack git:(n2) ✗ go clean -testcache && go test -timeout 30s -run ^TestDot$ github.com/celzero/firestack/intra/dns53 -v | grep -iE "(pool|retrier)"
retrier.go:220: D retrier: dial(SplitAuto,RetryAfterSplit,) 10.1.204.199:44998->213.188.216.9:853; strat: 1, rtt: 39ms; err? <nil>
retrier.go:357: I retrier: write: first?(true) [10.1.204.199:44998=>213.188.216.9:853] 1490; 1st write-err? <nil>
retrier.go:289: V retrier: read: [10.1.204.199:44998<=213.188.216.9:853] 576; err: <nil>
retrier.go:289: V retrier: read: [10.1.204.199:44998<=213.188.216.9:853] 2864; err: <nil>
retrier.go:289: V retrier: read: [10.1.204.199:44998<=213.188.216.9:853] 626; err: <nil>
dot.go:221: V dot: pool: (test0) put for 824634754688; ok? true
connpool.go:245: D pool: 10.1.204.199:44998=>213.188.216.9:853 readable? true; err? <nil>
connpool.go:163: D pool: 824634754688 get: empty? false, timedout? false
dot.go:239: V dot: pool: (test0) got conn from 824634754688; 1
retrier.go:289: V retrier: read: [10.1.204.199:44998<=213.188.216.9:853] 141; err: <nil>
dot.go:221: V dot: pool: (test0) put for 824634754688; ok? true
connpool.go:245: D pool: 10.1.204.199:44998=>213.188.216.9:853 readable? true; err? <nil>
connpool.go:163: D pool: 824634754688 get: empty? false, timedout? false
dot.go:239: V dot: pool: (test0) got conn from 824634754688; 2
retrier.go:289: V retrier: read: [10.1.204.199:44998<=213.188.216.9:853] 201; err: <nil>
dot.go:221: V dot: pool: (test0) put for 824634754688; ok? true
connpool.go:245: D pool: 10.1.204.199:44998=>213.188.216.9:853 readable? true; err? <nil>
connpool.go:163: D pool: 824634754688 get: empty? false, timedout? false
dot.go:239: V dot: pool: (test0) got conn from 824634754688; 3
retrier.go:289: V retrier: read: [10.1.204.199:44998<=213.188.216.9:853] 273; err: <nil>
dot.go:221: V dot: pool: (test0) put for 824634754688; ok? true

# without pooling (retrier consumes 2x bandwidth; 2 outgoing packets per DNS query)
➜  firestack git:(n2) ✗ go clean -testcache && go test -timeout 30s -run ^TestDot$ github.com/celzero/firestack/intra/dns53 -v | grep -iE "(pool|retrier)"
retrier.go:220: D retrier: dial(SplitAuto,RetryAfterSplit,) 10.1.204.199:36782->213.188.216.9:853; strat: 1, rtt: 40ms; err? <nil>
retrier.go:357: I retrier: write: first?(true) [10.1.204.199:36782=>213.188.216.9:853] 1490; 1st write-err? <nil>
retrier.go:289: V retrier: read: [10.1.204.199:36782<=213.188.216.9:853] 576; err: <nil>
retrier.go:289: V retrier: read: [10.1.204.199:36782<=213.188.216.9:853] 2865; err: <nil>
retrier.go:289: V retrier: read: [10.1.204.199:36782<=213.188.216.9:853] 542; err: <nil>
retrier.go:289: V retrier: read: [10.1.204.199:36782<=213.188.216.9:853] 84; err: <nil>
retrier.go:220: D retrier: dial(SplitAuto,RetryAfterSplit,) 10.1.204.199:36794->213.188.216.9:853; strat: 1, rtt: 43ms; err? <nil>
retrier.go:357: I retrier: write: first?(true) [10.1.204.199:36794=>213.188.216.9:853] 1761; 1st write-err? <nil>
retrier.go:289: V retrier: read: [10.1.204.199:36794<=213.188.216.9:853] 225; err: <nil>
retrier.go:289: V retrier: read: [10.1.204.199:36794<=213.188.216.9:853] 141; err: <nil>
retrier.go:220: D retrier: dial(SplitAuto,RetryAfterSplit,) 10.1.204.199:36810->213.188.216.9:853; strat: 1, rtt: 42ms; err? <nil>
retrier.go:357: I retrier: write: first?(true) [10.1.204.199:36810=>213.188.216.9:853] 1761; 1st write-err? <nil>
retrier.go:289: V retrier: read: [10.1.204.199:36810<=213.188.216.9:853] 225; err: <nil>
retrier.go:289: V retrier: read: [10.1.204.199:36810<=213.188.216.9:853] 201; err: <nil>
retrier.go:220: D retrier: dial(SplitAuto,RetryAfterSplit,) 10.1.204.199:36822->213.188.216.9:853; strat: 1, rtt: 44ms; err? <nil>
retrier.go:357: I retrier: write: first?(true) [10.1.204.199:36822=>213.188.216.9:853] 1761; 1st write-err? <nil>
retrier.go:289: V retrier: read: [10.1.204.199:36822<=213.188.216.9:853] 225; err: <nil>
retrier.go:289: V retrier: read: [10.1.204.199:36822<=213.188.216.9:853] 273; err: <nil>

ignoramous referenced this issue Oct 20, 2024
unclear if timer.Ticker would force wake up and/or prevent sleep
ignoramous referenced this issue Oct 20, 2024
reads from the chan are immediately written back in to it, and so the outer
unconditional for-loop spins forever as the chan never runs out of elements.
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

No branches or pull requests

1 participant