Skip to content

fix: leaked dev servers and truncated new READMEs - #28

Merged
lissy93 merged 1 commit into
lissy93:mainfrom
2u841r:fix/dev-server-cleanup
Jul 27, 2026
Merged

fix: leaked dev servers and truncated new READMEs#28
lissy93 merged 1 commit into
lissy93:mainfrom
2u841r:fix/dev-server-cleanup

Conversation

@2u841r

@2u841r 2u841r commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Two small bugs I ran into while benchmarking locally. Unrelated to each other, but both one-liners in spirit, so I've kept them together.

Dev servers were surviving the benchmark. dev_server.py starts them with shell=True, then cleans up with process.terminate(). That only signals the shell, so the dev server itself carries on running and holds its port. Most of the time you just end up with an orphan process, but any CLI that writes a lock file will then refuse to start on the next run. They now get their own process group, and cleanup signals the group.

New app READMEs were coming out truncated. There's a misparenthesized ternary in the create-a-new-file path of build_app_readme.py:

f"{sections['real_world_app']}\n\n" if sections['real_world_app'] else ""
"<!-- start_framework_specific -->\n\n"

The conditional binds to the whole expression, so everything after it becomes part of the else branch. A freshly generated README silently loses its framework specific block and the entire license footer. Existing READMEs go down the update path instead, which is why this has never shown up.

Tested locally, and I ran the Lint and Test workflows on my fork against this branch, both passing.

Two independent bugs, both found while running the benchmark suite.

dev_server.py spawned dev servers with shell=True but cleaned up with
process.terminate(), which only signals the shell. The dev server itself
survived the benchmark, holding its port and, for CLIs that use a lock
file, blocking every later run. Dev servers now start in their own
process group and cleanup signals the whole group.

build_app_readme.py had a misparenthesized ternary in the create-new-file
path:

    f"{sections['real_world_app']}\n\n" if sections['real_world_app'] else ""
    "<!-- start_framework_specific -->\n\n"

The conditional binds to the whole expression, so the trailing literals
became part of the else branch. Any newly created README silently lost
its framework-specific block and its entire license footer. Existing
READMEs were unaffected, which is why this went unnoticed.
github-actions Bot pushed a commit to sathvikc/framework-benchmarks that referenced this pull request Jul 26, 2026
github-actions Bot pushed a commit to nigrosimone/framework-benchmarks that referenced this pull request Jul 26, 2026

@lissy93 lissy93 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks :)

@lissy93
lissy93 merged commit 1b03bd3 into lissy93:main Jul 27, 2026
24 checks passed
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