8000 Optimize SSE build event streaming by analytically · Pull Request #9169 · concourse/concourse · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Optimize SSE build event streaming #9169

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

analytically
Copy link
Contributor
  • Replace fmt.Sscanf with strconv.ParseUint for more efficient header parsing
  • Replace fmt.Sprintf("%d", id) with strconv.FormatUint for more efficient string conversion
  • Use Header().Set() to prevent duplicate headers
  • Add validation for http.Flusher type assertion
  • Improve error handling and logging context
  • Enhance code readability with consistent structure and formatting
  • Refactor event writing for better maintainability

- Replace fmt.Sscanf with strconv.ParseUint for more efficient header parsing
- Replace fmt.Sprintf("%d", id) with strconv.FormatUint for more efficient string conversion
- Use Header().Set() to prevent duplicate headers
- Add validation for http.Flusher type assertion
- Improve error handling and logging context
- Enhance code readability with consistent structure and formatting
- Refactor event writing for better maintainability

Signed-off-by: Mathias Bogaert <mathias.bogaert@gmail.com>
@analytically analytically requested a review from a team as a code owner March 29, 2025 12:18
w.WriteHeader(http.StatusBadRequest)
return
}

eventID++
eventID = uint(parsedID) + 1

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types High

Incorrect conversion of an unsigned 64-bit integer from
strconv.ParseUint
to a lower bit size type uint without an upper bound check.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we're well past 32 bit these days smh

@analytically
Copy link
Contributor Author

In combo with vito/go-sse#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant
0