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

playground app start in new port each time #61

Closed
onemen opened this issue May 6, 2023 · 8 comments
Closed

playground app start in new port each time #61

onemen opened this issue May 6, 2023 · 8 comments

Comments

@onemen
Copy link
Contributor

onemen commented May 6, 2023

With the latest kcdshop 1.36.0
When calling SET TO PLAYGROUND while playground app is running the app starts in a new port each time.
see the following log from my terminal.

playground start in new port each time
> start
> kcdshop start

🐨  Let's get learning!
Local:            http://localhost:5639
On Your Network:  http://10.100.102.21:5639
Press Ctrl+C to stop
[playground:4000]
[playground:4000] > dev
[playground:4000] > cross-env NODE_ENV=development run-p dev:*
[playground:4000]
[playground:4000]
[playground:4000]
[playground:4000] > dev:server
[playground:4000] > tsx watch --clear-screen=false --ignore "app/**" --ignore "build/**" --ignore "node_modules/**" ./index.js
[playground:4000]
[playground:4000]
[playground:4000]
[playground:4000] > dev:remix
[playground:4000] > cross-env PORT="" remix dev
[playground:4000]
[playground:4000]
[playground:4000] 🚀  We have liftoff!
[playground:4000]
[playground:4000] Local:            http://localhost:4000
[playground:4000] On Your Network:  http://10.100.102.21:4000
[playground:4000] Press Ctrl+C to stop
[playground:4000]
[playground:4000] Loading environment variables from .env
[playground:4000]
[playground:4000] 💿 Built in 3.6s
[playground:4000]
[playground:4000] HEAD / 200 - - 1780.743 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 2562.259 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 4638.000 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 1567.058 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 5364.723 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 4072.458 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 5895.709 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 3321.068 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 2567.434 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 5156.572 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 3103.653 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 4648.982 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 2340.124 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 3893.589 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 5717.470 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 3644.772 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 4428.679 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 332.660 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 302.935 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 271.728 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 237.418 ms
[playground:4000]
[playground:4000] HEAD / 200 - - 138.150 ms
[playground:4000]
[playground:4000] GET / 200 - - 61.523 ms
[playground:4000]
[playground:4000] GET / 200 - - 52.042 ms
[playground:4000]
[playground:4000] GET / 200 - - 88.912 ms
[playground:4000]
[playground:4000] exited (null)
[playground:4000]
[playground:4000] > dev
[playground:4000] > cross-env NODE_ENV=development run-p dev:*
[playground:4000]
[playground:4000]
[playground:4000]
[playground:4000] > dev:server
[playground:4000] > tsx watch --clear-screen=false --ignore "app/**" --ignore "build/**" --ignore "node_modules/**" ./index.js
[playground:4000]
[playground:4000]
[playground:4000]
[playground:4000] > dev:remix
[playground:4000] > cross-env PORT="" remix dev
[playground:4000]
[playground:4000]
[playground:4000] ⚠️  Port 4000 is not available, using 4001 instead.
[playground:4000]
[playground:4000] 🚀  We have liftoff!
[playground:4000]
[playground:4000] Local:            http://localhost:4001
[playground:4000] On Your Network:  http://10.100.102.21:4001
[playground:4000] Press Ctrl+C to stop
[playground:4000]
[playground:4000] Loading environment variables from .env
[playground:4000]
[playground:4000] 💿 Built in 3.5s
[playground:4000]
[playground:4000] exited (null)
[playground:4000]
[playground:4000] > dev
[playground:4000] > cross-env NODE_ENV=development run-p dev:*
[playground:4000]
[playground:4000]
[playground:4000]
[playground:4000] > dev:server
[playground:4000] > cross-env MOCKS=true tsx watch --clear-screen=false --ignore "app/**" --ignore "build/**" --ignore "node_modules/**" ./index.js
[playground:4000]
[playground:4000]
[playground:4000]
[playground:4000] > dev:remix
[playground:4000] > cross-env PORT="" remix dev
[playground:4000]
[playground:4000]
[playground:4000] 🔶 Mock server installed
[playground:4000]
[playground:4000] Loading environment variables from .env
[playground:4000]
[playground:4000] ⚠️  Port 4000 is not available, using 4002 instead.
[playground:4000]
[playground:4000] 🚀  We have liftoff!
[playground:4000]
[playground:4000] Local:            http://localhost:4002
[playground:4000] On Your Network:  http://10.100.102.21:4002
[playground:4000] Press Ctrl+C to stop
[playground:4000]
[playground:4000] 💿 Built in 3.7s
[playground:4000]

output from running netstat -aon in Windows 11 terminal, there are many:
TCP some_ip_address:4000 some_ip_address:64999 TIME_WAIT 0
(i've removed the real ips)

Active Connections on Windows
Active Connections

Proto  Local Address          Foreign Address        State           PID
TCP    ip_address:135            ip_address:0              LISTENING       1396
TCP    ip_address:445            ip_address:0              LISTENING       4
TCP    ip_address:1042           ip_address:0              LISTENING       17360
TCP    ip_address:1043           ip_address:0              LISTENING       17360
TCP    ip_address:2179           ip_address:0              LISTENING       2740
TCP    ip_address:3001           ip_address:0              LISTENING       6556
TCP    ip_address:3002           ip_address:0              LISTENING       7780
TCP    ip_address:3003           ip_address:0              LISTENING       5528
TCP    ip_address:4001           ip_address:0              LISTENING       18784
TCP    ip_address:4002           ip_address:0              LISTENING       4812
TCP    ip_address:5040           ip_address:0              LISTENING       7576
TCP    ip_address:5357           ip_address:0              LISTENING       4
TCP    ip_address:5639           ip_address:0              LISTENING       18676
TCP    ip_address:5985           ip_address:0              LISTENING       4
TCP    ip_address:7680           ip_address:0              LISTENING       4192
TCP    ip_address:9012           ip_address:0              LISTENING       13476
TCP    ip_address:9013           ip_address:0              LISTENING       13476
TCP    ip_address:9014           ip_address:0              LISTENING       9592
TCP    ip_address:47001          ip_address:0              LISTENING       4
TCP    ip_address:49664          ip_address:0              LISTENING       1140
TCP    ip_address:49665          ip_address:0              LISTENING       8
TCP    ip_address:49666          ip_address:0              LISTENING       1740
TCP    ip_address:49667          ip_address:0              LISTENING       3064
TCP    ip_address:49674          ip_address:0              LISTENING       4084
TCP    ip_address:49687          ip_address:0              LISTENING       1116
TCP    some_ip_address:139      ip_address:0              LISTENING       4
TCP    some_ip_address:4000     some_ip_address:64999    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65000    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65001    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65002    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65003    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65004    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65005    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65006    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65007    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65008    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65009    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65010    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65011    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65012    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65013    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65014    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65015    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65016    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65017    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65018    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65019    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65020    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65021    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65022    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65023    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65024    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65025    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65026    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65027    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65028    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65029    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65030    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65031    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65032    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65033    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65034    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65035    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65036    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65038    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65039    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65040    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65041    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65042    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65043    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65044    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65045    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65046    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65047    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65048    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65049    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65050    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65051    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65052    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65053    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65054    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65055    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65056    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65057    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65058    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65059    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65060    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65061    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65062    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65063    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65064    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65065    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65066    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65067    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65068    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65069    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65070    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65071    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65072    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65073    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65074    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65075    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65076    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65077    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65078    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65079    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65080    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65081    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65082    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65083    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65084    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65085    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65086    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65087    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65089    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65090    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65091    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65092    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65093    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65094    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65095    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65096    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65097    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65098    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65099    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65100    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65101    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65102    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65103    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65104    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65105    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65106    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65107    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65108    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65109    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65110    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65111    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65112    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65113    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65114    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65115    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65116    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65117    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65118    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65119    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65120    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65121    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65122    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65123    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65124    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65125    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65126    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65127    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65128    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65129    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65131    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65132    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65133    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65134    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65135    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65136    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65137    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65138    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65139    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65140    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65141    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65142    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65143    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65144    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65145    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65146    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65147    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65148    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65149    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65150    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65151    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65152    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65154    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65155    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65156    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65157    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65158    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65159    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65160    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65161    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65162    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65163    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65164    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65165    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65166    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65167    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65168    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65169    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65170    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65171    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65172    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65173    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65174    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65175    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65176    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65177    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65178    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65179    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65180    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65181    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65182    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65183    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65184    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65185    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65186    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65187    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65188    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65189    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65190    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65191    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65192    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65193    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65194    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65195    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65196    TIME_WAIT       0
TCP    some_ip_address:4000     some_ip_address:65197    TIME_WAIT       0
TCP    some_ip_address:59816    ip_address:8883    ESTABLISHED     2532
TCP    some_ip_address:59822    ip_address:443      ESTABLISHED     4396
TCP    some_ip_address:59922    ip_address:443      ESTABLISHED     11724
TCP    some_ip_address:61303    ip_address:80      LAST_ACK        7784
TCP    some_ip_address:62289    ip_address:443       ESTABLISHED     15072
TCP    some_ip_address:62300    ip_address:443      ESTABLISHED     15072
TCP    some_ip_address:62586    ip_address:443      TIME_WAIT       0
TCP    some_ip_address:63707    ip_address:443    ESTABLISHED     15072
TCP    some_ip_address:64355    ip_address:80       TIME_WAIT       0
TCP    some_ip_address:64362    ip_address:443      TIME_WAIT       0
TCP    some_ip_address:64374    ip_address:443      TIME_WAIT       0
TCP    some_ip_address:64377    ip_address:443      TIME_WAIT       0
TCP    some_ip_address:64385    ip_address:80       TIME_WAIT       0
TCP    some_ip_address:64386    ip_address:80       TIME_WAIT       0
TCP    some_ip_address:64393    ip_address:80       TIME_WAIT       0
TCP    some_ip_address:64452    ip_address:443        TIME_WAIT       0
TCP    some_ip_address:64467    ip_address:80          TIME_WAIT       0
TCP    some_ip_address:64488    ip_address:443      ESTABLISHED     15072
TCP    some_ip_address:65037    some_ip_address:4000     TIME_WAIT       0
TCP    some_ip_address:65088    some_ip_address:4000     TIME_WAIT       0
TCP    some_ip_address:65130    some_ip_address:4000     TIME_WAIT       0
TCP    some_ip_address:65153    some_ip_address:4000     TIME_WAIT       0
TCP    some_ip_address:65221    ip_address:443      ESTABLISHED     14456
TCP    some_ip_address:65244    ip_address:443      ESTABLISHED     11800
TCP    some_ip_address:65245    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65246    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65247    ip_address:443       ESTABLISHED     7784
TCP    some_ip_address:65252    ip_address:443     ESTABLISHED     7784
TCP    some_ip_address:65254    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65255    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65256    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65257    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65258    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65259    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65260    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65261    ip_address:443     ESTABLISHED     7784
TCP    some_ip_address:65262    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65263    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65264    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65265    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65266    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65267    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65268    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65269    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65270    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65271    ip_address:443      ESTABLISHED     7784
TCP    some_ip_address:65272    ip_address:443     ESTABLISHED     7784
TCP    some_ip_address:65273    some_ip_address:4000     SYN_SENT        6556
TCP    ip_address:1042         ip_address:59918        ESTABLISHED     17360
TCP    ip_address:1043         ip_address:59913        ESTABLISHED     17360
TCP    ip_address:13030        ip_address:0              LISTENING       4612
TCP    ip_address:13030        ip_address:49683        ESTABLISHED     4612
TCP    ip_address:22112        ip_address:0              LISTENING       4612
TCP    ip_address:28385        ip_address:0              LISTENING       4
TCP    ip_address:28390        ip_address:0              LISTENING       4
TCP    ip_address:49683        ip_address:13030        ESTABLISHED     4612
TCP    ip_address:59913        ip_address:1043         ESTABLISHED     13476
TCP    ip_address:59918        ip_address:1042         ESTABLISHED     11748
TCP    ip_address:59965        ip_address:59966        ESTABLISHED     15072
TCP    ip_address:59966        ip_address:59965        ESTABLISHED     15072
TCP    ip_address:59967        ip_address:59968        ESTABLISHED     10544
TCP    ip_address:59968        ip_address:59967        ESTABLISHED     10544
TCP    ip_address:139        ip_address:0              LISTENING       4
TCP    ip_address:139       ip_address:0              LISTENING       4
TCP    [::]:135               [::]:0                 LISTENING       1396
TCP    [::]:445               [::]:0                 LISTENING       4
TCP    [::]:1042              [::]:0                 LISTENING       17360
TCP    [::]:1043              [::]:0                 LISTENING       17360
TCP    [::]:2179              [::]:0                 LISTENING       2740
TCP    [::]:3001              [::]:0                 LISTENING       6556
TCP    [::]:3002              [::]:0                 LISTENING       7780
TCP    [::]:3003              [::]:0                 LISTENING       5528
TCP    [::]:4001              [::]:0                 LISTENING       18784
TCP    [::]:4002              [::]:0                 LISTENING       4812
TCP    [::]:5357              [::]:0                 LISTENING       4
TCP    [::]:5639              [::]:0                 LISTENING       18676
TCP    [::]:5985              [::]:0                 LISTENING       4
TCP    [::]:7680              [::]:0                 LISTENING       4192
TCP    [::]:9012              [::]:0                 LISTENING       13476
TCP    [::]:9013              [::]:0                 LISTENING       13476
TCP    [::]:9014              [::]:0                 LISTENING       9592
TCP    [::]:47001             [::]:0                 LISTENING       4
TCP    [::]:49664             [::]:0                 LISTENING       1140
TCP    [::]:49665             [::]:0                 LISTENING       8
TCP    [::]:49666             [::]:0                 LISTENING       1740
TCP    [::]:49667             [::]:0                 LISTENING       3064
TCP    [::]:49674             [::]:0                 LISTENING       4084
TCP    [::]:49687             [::]:0                 LISTENING       1116
TCP    [::1]:3001             [::1]:62654            ESTABLISHED     6556
TCP    [::1]:5639             [::1]:62587            ESTABLISHED     18676
TCP    [::1]:62587            [::1]:5639             ESTABLISHED     14396
TCP    [::1]:62654            [::1]:3001             ESTABLISHED     14396
UDP    ip_address:53             *:*                                    3212
UDP    ip_address:123            *:*                                    13652
UDP    ip_address:500            *:*                                    4404
UDP    ip_address:3702           *:*                                    2572
UDP    ip_address:3702           *:*                                    6044
UDP    ip_address:3702           *:*                                    6044
UDP    ip_address:3702           *:*                                    2572
UDP    ip_address:4500           *:*                                    4404
UDP    ip_address:5050           *:*                                    7576
UDP    ip_address:5353           *:*                                    2468
UDP    ip_address:5355           *:*                                    2468
UDP    ip_address:49157          *:*                                    2468
UDP    ip_address:50374          *:*                                    6044
UDP    ip_address:51120          *:*                                    2468
UDP    ip_address:52452          ip_address:53                        2532
UDP    ip_address:54475          *:*                                    3212
UDP    ip_address:54476          *:*                                    3212
UDP    ip_address:55132          *:*                                    2572
UDP    ip_address:62706          *:*                                    2468
UDP    ip_address:62894          *:*                                    2468
UDP    ip_address:64400          ip_address:53535                    2532
UDP    some_ip_address:137      *:*                                    4
UDP    some_ip_address:138      *:*                                    4
UDP    some_ip_address:1900     *:*                                    3412
UDP    some_ip_address:56739    *:*                                    3412
UDP    ip_address:1900         *:*                                    3412
UDP    ip_address:51123        *:*                                    3412
UDP    ip_address:52280        ip_address:52280                        4168
UDP    ip_address:57509        *:*                                    2532
UDP    ip_address:67         *:*                                    3212
UDP    ip_address:68         *:*                                    3212
UDP    ip_address:137        *:*                                    4
UDP    ip_address:138        *:*                                    4
UDP    ip_address:1900       *:*                                    3412
UDP    ip_address:51124      *:*                                    3412
UDP    ip_address:137       *:*                                    4
UDP    ip_address:138       *:*                                    4
UDP    ip_address:1900      *:*                                    3412
UDP    ip_address:56740     *:*                                    3412
UDP    [::]:123               *:*                                    13652
UDP    [::]:500               *:*                                    4404
UDP    [::]:3702              *:*                                    2572
UDP    [::]:3702              *:*                                    2572
UDP    [::]:3702              *:*                                    6044
UDP    [::]:3702              *:*                                    6044
UDP    [::]:4500              *:*                                    4404
UDP    [::]:5353              *:*                                    2468
UDP    [::]:5355              *:*                                    2468
UDP    [::]:49157             *:*                                    2468
UDP    [::]:50375             *:*                                    6044
UDP    [::]:51120             *:*                                    2468
UDP    [::]:54477             *:*                                    3212
UDP    [::]:55133             *:*                                    2572
UDP    [::]:62706             *:*                                    2468
UDP    [::]:62894             *:*                                    2468
UDP    [::1]:1900             *:*                                    3412
UDP    [::1]:56737            *:*                                    3412
UDP    [fe80::644f:4fc7:60cb:56bf%17]:1900  *:*                                    3412
UDP    [fe80::644f:4fc7:60cb:56bf%17]:56735  *:*                                    3412
UDP    [fe80::aa32:b179:a649:22fd%20]:1900  *:*                                    3412
UDP    [fe80::aa32:b179:a649:22fd%20]:56738  *:*                                    3412
UDP    [fe80::f70f:5436:7f28:95f8%13]:1900  *:*                                    3412
UDP    [fe80::f70f:5436:7f28:95f8%13]:56736  *:*                                    3412
@kentcdodds
Copy link
Member

I can't reproduce this issue. When we set the playground we:

  1. Close the process -> https://github.com/epicweb-dev/kcdshop/blob/b6c7cb8dd71d2ce813850f6bacc47c009b62ca6c/packages/workshop-app/utils/apps.server.ts#L909
  2. Which stops the port -> https://github.com/epicweb-dev/kcdshop/blob/b6c7cb8dd71d2ce813850f6bacc47c009b62ca6c/packages/workshop-app/utils/process-manager.server.ts#L277
  3. Which waits for the port to become available again -> https://github.com/epicweb-dev/kcdshop/blob/b6c7cb8dd71d2ce813850f6bacc47c009b62ca6c/packages/workshop-app/utils/process-manager.server.ts#L287

And only after that is all done do we copy things over and start the server up again.

So I have no idea how this could happen 🤔

@onemen
Copy link
Contributor Author

onemen commented May 9, 2023

maybe it is related to this "unstable_dev" doesn't kill app server on exit (Windows)

@kentcdodds
Copy link
Member

That does appear to be related. windowsHide: false would probably fix it. Do you think you can test that out?

@onemen
Copy link
Contributor Author

onemen commented May 10, 2023

I wanted to clarify that i've tested it on testing-web-apps using latest kcdshop 1.36.0.

windowsHide: false is the default in node, I tested both windowsHide: false and windowsHide: true with the same result as mentioned above.
I also verified that build/remix.js did call closeProcess and stopPort.

this helped

export async function closeProcess(key: string) {
	const proc = devProcesses.get(key)
	if (proc) {
+		if (process.platform === 'win32') {
+			const { execa } = await import('execa')
+			await execa('taskkill', ['/pid', String(proc.process.pid), '/f', '/t'])
+		} else {
			proc.process.kill()
+		}
		await stopPort(proc.port) // 🤷‍♂️
		devProcesses.delete(key)
	}
}

@kentcdodds
Copy link
Member

Interesting. Well, I guess we should do that then. Thanks for the research!

@onemen
Copy link
Contributor Author

onemen commented May 10, 2023

It will be interesting to see how kcdshop and the workshop apps will work with remix v1.16 with --no-restart, maybe it will eliminate the need to closeProcess if playground already running

@onemen
Copy link
Contributor Author

onemen commented Jun 9, 2023

fixed by #69

@onemen onemen closed this as completed Jun 9, 2023
@kentcdodds
Copy link
Member

Yay!

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

2 participants