-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Several 2.0 regression fixes #876
Changes from 6 commits
dd9db5e
1755870
35f80ca
1cab059
d304e47
81b379e
fd46d88
835a754
e9b1754
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ import ( | |
"fmt" | ||
"io" | ||
"net" | ||
"os" | ||
"os/user" | ||
"regexp" | ||
"strings" | ||
|
@@ -238,7 +239,8 @@ func (s *SrvSuite) TestAgentForward(c *C) { | |
_, err = io.WriteString(writer, fmt.Sprintf("printenv %v\n\r", teleport.SSHAuthSock)) | ||
c.Assert(err, IsNil) | ||
|
||
re := regexp.MustCompile(`/tmp/[^\s]+`) | ||
pattern := fmt.Sprintf(`%vteleport-[0-9]+[^\s]+`, os.TempDir()) | ||
re := regexp.MustCompile(pattern) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not actually the line that has the problem, but it's the loop below: for i := 0; i < 3; i++ {
_, err = reader.Read(buf)
c.Assert(err, IsNil)
matches = re.FindStringSubmatch(string(buf))
if len(matches) != 0 {
break
}
time.Sleep(50 * time.Millisecond)
} On Linux tests hang on the line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let me try to fix that |
||
buf := make([]byte, 4096) | ||
var matches []string | ||
for i := 0; i < 3; i++ { | ||
|
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.
@russjones this overwrites the user-supplied value at all times, what should not be the case. We should only overwrite the value if user haven't supplied the value. You can fix that yourself as @kontsevoy is OOO at the moment.
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.
@klizhentas there are no user-supplied values in
StorageConfig.Params
[1]. Storage config is a static, backend-specific YAML configuration, with "data_dir" being a reserved word. In fact, we guarantee the presence of "data_dir" in.Params
(and back-end code expects it to be there) This needs to be reflected in backend developer README. In other words, this behavior is as-designed.[1] Bolt used to accept an arbitrary JSON string, so that's why you think there are user-supplied values. This is no longer true since the Great Christmas-2016 Back-end Redesign
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.
I think users can supply Params["path"] for backend, at least what I have observed in configs and the code, so I don't quite understand the fix then. Why is it setting "data_dir" and not "path" like for example "boltdb" requires.
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.
My question basically is - can you explain to me how does this change fixes the case reported here:
#867
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.
@russjones: @kontsevoy explained to me how it works, so this part lgtm, please fix the part with socket path and merge the whole thing