Fix data races across session/forwarder/registry, resolve POST/PUT hang, harden port allocation, add frontendURL env #157
Reference in New Issue
Block a user
Delete Branch "staging"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Consolidates race condition, concurrency, and lifecycle-safety fixes across the session, transport, forwarder, and port-registry packages, plus one small feature addition.
Bug Fixes
SetChannel(),Channel(), andStartedAt()with mutex protectionwaitForTCPIPForward()failing on non-tcpip-forwardglobal requestsforwarderandslugstructs viasync.RWMutexHandleTCPForward()from outer-scopeerrvariable captureAddRangeinfinite loop whenendPort == 65535(uint16 wraparound)Claimbypassing the allowed port rangeUnassignedhanding out the same port to concurrent callersSetStatussilently creating entries for unknown portsregistry.UpdateImprovements
Close()to release the lock before calling external code, avoiding deadlocksCLOSEDa terminal state —SetChannel()/SetStatus()reject calls afterClose()PortRegistryinterface for interface segregationstartedAtwhen the session starts running, not at constructionFeature
frontendURLenv varCommits
e8be839dac6fd25387f74118872ed861a4791bcbf1fa9332acd0a5033964Fix race conditions and improve lifecycle safety (#150)to Fix data races across session/forwarder/registry, resolve POST/PUT hang, harden port allocation, add frontendURL env