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

fix: Resolve race condition in HTTP server handling #21

Closed
wants to merge 3 commits into from

Conversation

daveads
Copy link
Contributor

@daveads daveads commented Oct 3, 2024

fix: Resolve race condition in HTTP server handling

  • Implement thread-safe safeServer to wrap http.Server
  • Modify Serve function to use safeServer for improved concurrency
  • Ensure atomic operations for server start and shutdown

This change addresses a race condition in the HTTP server handling,particularly affecting CLI tests. By introducing a safeServer struct with atomic operations and proper synchronization, and prevent potential data races during server startup and shutdown.

Fix for terrastruct/d2#2087

@daveads daveads closed this Oct 3, 2024
@daveads daveads deleted the resolve-race branch October 3, 2024 11:16
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.

1 participant