Skip to content

device: extract pool into standalone package#54

Open
illotum wants to merge 1 commit into
tailscalefrom
illotum/extract-waitpool
Open

device: extract pool into standalone package#54
illotum wants to merge 1 commit into
tailscalefrom
illotum/extract-waitpool

Conversation

@illotum

@illotum illotum commented Apr 10, 2026

Copy link
Copy Markdown

e.g. to access it without importing device.

Copilot AI review requested due to automatic review settings April 10, 2026 03:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR extracts the WaitPool implementation from the device package into a new standalone waitpool package so it can be imported independently of device.

Changes:

  • Added a new waitpool package providing WaitPool and its New/Get/Put API.
  • Updated device to use waitpool.WaitPool and waitpool.New for its internal pools.
  • Moved existing pool tests into the waitpool package and updated references accordingly.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
waitpool/waitpool.go Introduces the standalone WaitPool implementation.
waitpool/waitpool_test.go Updates tests to target the new waitpool package and constructor name.
waitpool/race_enabled_test.go Updates test package name to waitpool under -race build tag.
waitpool/race_disabled_test.go Updates test package name to waitpool under !race build tag.
device/pools.go Switches pool initialization from the old in-package type to waitpool.New.
device/device.go Updates pool field types to *waitpool.WaitPool and imports waitpool.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread waitpool/waitpool.go
Comment thread waitpool/waitpool.go Outdated
@illotum
illotum force-pushed the illotum/extract-waitpool branch 4 times, most recently from 3ade42b to 20486f7 Compare April 10, 2026 04:27
@illotum
illotum requested a review from jwhited April 10, 2026 17:09
@illotum
illotum force-pushed the illotum/extract-waitpool branch 2 times, most recently from 0824a03 to 14fb57a Compare May 26, 2026 18:56
@illotum illotum self-assigned this May 26, 2026
@illotum
illotum force-pushed the illotum/extract-waitpool branch from 14fb57a to dfe5c44 Compare June 5, 2026 18:26
@illotum
illotum force-pushed the illotum/extract-waitpool branch from dfe5c44 to 9a76d87 Compare June 16, 2026 20:55
Also fixes Put-before-Get underflow bug.

Signed-off-by: Alex Valiushko <alexvaliushko@tailscale.com>
Change-Id: Icde836d1bef2e95850d3ae51b3c069056a6a6964
@illotum
illotum force-pushed the illotum/extract-waitpool branch from 9a76d87 to 719bd21 Compare June 18, 2026 19:21
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.

2 participants