-
Notifications
You must be signed in to change notification settings - Fork 139
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
Improve socat connection success detection using KMP #2506
Conversation
PTAL @lkingland @matzew @gauron99 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2506 +/- ##
==========================================
+ Coverage 61.49% 67.11% +5.62%
==========================================
Files 129 129
Lines 15381 11990 -3391
==========================================
- Hits 9458 8047 -1411
+ Misses 4989 2972 -2017
- Partials 934 971 +37
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Also why the hell is |
That might be a GitHub flake, because it only appears twice here in the summary, but once on the "Checks" screen 🤷🏻 |
Looks like the codecov double-result is still holding up the merge. Going to retest... |
/override codecov/project |
@matejvasek: matejvasek unauthorized: /override is restricted to Repo administrators. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
It appears that Go's MatchReader() returns true only if some new lines are written to the writer after the searched word. It mostly all right because socat actually writes several more lines to stderr. However this new implementation is better it should signal immediately when searched patter is written to the writer. Signed-off-by: Matej Vašek <[email protected]>
@dsimansk @matzew @lkingland PTAL |
PTAL @gauron99 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gauron99, lkingland, matejvasek The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
It appears that Go's
MatchReader()
returnstrue
only if two characters are written to the writer after the searched word. Thta's mostly all right becausesocat
actually writes several more lines to stderr. However this new implementation is better it should signal immediately when searched patter is written to the writer.See: https://pkg.go.dev/github.com/agext/regexp#section-documentation
See also: https://stackoverflow.com/questions/76559206/how-to-match-a-regular-expression-on-a-slow-hanging-io-reader-in-go
KMP: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm