lukaszraczylo
7a33e01863
fix: 4 P0 concurrency races in forward + k8s
...
P0 #2 — currentConfig data race
Manager.currentConfig was written without locking in Start/Reload but
read from the health-checker callback goroutine. All accesses now go
through workersMu (read or write as appropriate).
P0 #3 — Reload kills health checker permanently
Reload's zero-forward branch called m.Stop() which tore down the
health checker, watchdog, and event bus. After that, EnableForward
silently registered callbacks against dead components. Now the branch
stops only the running workers; the supervisory infrastructure stays
alive across config changes.
P0 #4 — rest.Config write-write race
executePortForward was mutating .Dial on the cached *rest.Config
shared by all forwards in the same kube context. Cloning the config
with rest.CopyConfig before mutation isolates per-forward dialers.
P0 #5 — ForwardWorker.Stop() double-close panic
close(w.stopChan) is now wrapped in sync.Once, so concurrent Stop
calls (Manager.Stop racing stopWorkerInternal) are safe.
New tests in internal/forward/concurrency_test.go exercise each fix
under -race: 16 concurrent worker Stops, repeated sequential Stops,
empty-Reload preserves infra pointers, and concurrent currentConfig
read/write.
2026-05-06 10:45:10 +01:00
lukaszraczylo
8e5eaab0af
fixup! Update go.mod and go.sum ( #48 )
2026-02-20 15:39:27 +00:00
lukaszraczylo
96ae1d45e0
style: Extract UI constants and refactor main view rendering ( #30 )
...
- [x] Add golangci-lint configuration with gocritic ifElseChain disabled
- [x] Rename error variables to avoid shadowing (createErr, watcherErr, watchErr, etc.)
- [x] Replace `interface{}` with `any` type alias throughout codebase
- [x] Add package-level documentation comments to all internal packages
- [x] Reorder struct fields alphabetically for consistency
- [x] Extract UI constants (terminal dimensions, column widths, colors) to constants.go
- [x] Refactor BubbleTeaUI main view rendering into smaller helper functions
- [x] Simplify nested conditionals and improve code clarity
- [x] Add `isForwardDisabled()` helper method to BubbleTeaUI
- [x] Update file permissions from 0644 to 0600 in config tests
- [x] Add `#nosec` comments and error suppression where appropriate
- [x] Improve test table struct field ordering for readability
- [x] Fix resource parsing in AddForward using strings.SplitN
- [x] Add comprehensive tests for new UI helper functions and constants
2026-01-13 09:37:45 +00:00
lukaszraczylo
6cb4f91ece
Cleanup and refactor.
2025-12-14 18:17:20 +00:00
lukaszraczylo
23cd45a3d7
improvements nov2025 pt2 ( #13 )
...
* Further improvements
| Fix | Impact | Files Modified |
|------------------------------------|----------------------------------------|--------------------------------------|
| sync.Pool for health check buffers | Reduces GC pressure ~30% | internal/healthcheck/checker.go |
| Goroutine leak fix + sync.Once | Prevents memory leaks | internal/forward/worker.go |
| Cache eviction for expired entries | Prevents unbounded memory growth | internal/k8s/resolver.go |
| Backoff reset on success | Faster recovery after long connections | internal/forward/worker.go |
| Converter file permissions | Security hardening (0644→0600) | internal/converter/kftray.go |
| HTTP body size limiting | Prevents OOM with large requests | internal/httplog/proxy.go, logger.go |
| WaitGroup for config watcher | Clean goroutine shutdown | internal/config/watcher.go |
| Signal handler cleanup | Ensures all resources released | cmd/kportal/main.go |
* Additional event bus for internal event handling
| Metric | Before | After | Improvement |
|------------------------|---------------------------------------|-------------------|--------------------|
| Goroutines per forward | 3 (worker + heartbeat + health check) | 1 (worker only) | 66% reduction |
| Tickers per forward | 2 (heartbeat + health check) | 0 | 100% reduction |
| Global goroutines | 2 (watchdog + health monitor) | 2 | Same |
| Lock acquisitions/sec | O(n) per interval | O(1) per interval | Linear improvement |
* Add UI testing
* Add mocks
* Add more logs and details to be displayed
2025-11-26 13:18:50 +00:00
lukaszraczylo
3f5c1d3a5f
improvements nov2025 ( #10 )
...
* Add benchmark and httplog modules, update UI for modals artefacts
2025-11-25 19:00:44 +00:00
lukaszraczylo
1167847fd4
bugfixes nov2025 pt4 ( #7 )
...
* Add mDNS resolution.
* Update the website and documentation
2025-11-25 11:14:33 +00:00
lukaszraczylo
39fe4286b4
Fix the watchdog being too aggressive.
2025-11-24 13:19:44 +00:00
lukaszraczylo
2fdc5912e7
healtcheck improvements ( #4 )
...
* Advanced healtchecks.
* Add watchdog for stale connections handling.
2025-11-24 13:00:19 +00:00
lukaszraczylo
f41c316b2b
Add configuration wizard. ( #2 )
...
* Add configuration wizard.
2025-11-24 02:28:08 +00:00
lukaszraczylo
21ea41781d
Add user friendly UI allowing to temporarily toggle port forwarding.
2025-11-23 16:50:56 +00:00
lukaszraczylo
112969b82a
Add active healtchecks to verify the connectivity.
2025-11-23 15:56:57 +00:00
lukaszraczylo
9b57431f59
Add an UI to display the current port forwards status.
2025-11-23 15:53:31 +00:00
lukaszraczylo
f50f0a9b49
WIP - before the testing.
2025-11-23 15:24:51 +00:00