-
Notifications
You must be signed in to change notification settings - Fork 76
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 client trying to use “occupied file” for socket. #3200
base: main
Are you sure you want to change the base?
Conversation
3451846
to
4c00879
Compare
d793a2d
to
cf77e7d
Compare
bbd633d
to
4d5983f
Compare
3557cbd
to
2b77a59
Compare
Signed-off-by: avifenesh <[email protected]>
Signed-off-by: avifenesh <[email protected]>
…nd add glide_paths module Signed-off-by: avifenesh <[email protected]>
2b77a59
to
6e38e4c
Compare
Signed-off-by: avifenesh <[email protected]>
6e38e4c
to
f9a09b0
Compare
…erClient Signed-off-by: avifenesh <[email protected]>
0131ecf
to
164a408
Compare
@@ -73,10 +73,10 @@ native-tls = { version = "0.2", optional = true } | |||
tokio-native-tls = { version = "0.3", optional = true } | |||
|
|||
# Only needed for rustls | |||
rustls = { version = "0.22", optional = true } | |||
rustls = { version = "0.23.23", optional = true } |
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.
any reason we are locked into a specific minor version?
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 actually tried to do the opposite everywhere, mistake
@@ -160,13 +160,13 @@ disable-client-setinfo = [] | |||
tls = ["tls-native-tls"] # use "tls-native-tls" instead | |||
|
|||
[dev-dependencies] | |||
rand = "0.8" | |||
rand = "0.9" |
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.
imo, we should just use major version, e.g:
rand = "0"
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.
When its not stable yet, minor can be breaking as well, that's why under one i left the minor
root_store.add(cert)?; | ||
let native_certs = load_native_certs(); | ||
#[cfg(all( | ||
feature = "tls-rustls", |
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.
Do we support both versions? if so, why?
@@ -1,2 +1,2 @@ | |||
use_try_shorthand = true | |||
edition = "2018" | |||
edition = "2024" |
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.
will this break on older versions of Ubuntu, for example 22.04 LTS? (I am not sure which version of Rust they provide, but this might be a concern)
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.
we can also use 2021 if 2018 does not work with our current code base
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.
Break for usage or break for development?
} | ||
|
||
/// For ergonomics: Converts a string into a PathBuf. | ||
fn string_to_pathbuf(string: &str) -> PathBuf { |
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.
How is this shorter than writing PathBuf::from
?
pub glide_file: PathBuf, | ||
} | ||
/// GlidePaths struct implementation. | ||
impl GlidePaths { |
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.
When I suggested using a GlidePaths
struct, I was talking in general. However, your code always refers to the socket file. The struct
should be for "general purpose" for example, once stabilized, we should use it with other file related components (for example, a global location where we want to place our logs)
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.
Your comment was actually leading to the other direction 😅 i tried to still keep it a bit generic.
Let's put it this way -
- Want generic file struct
- I want it to be handy for, for example, doing socket file tasks. Meaning i do want the struct to have some special sockets functionality in addition.
- I don't want to create a whole component which is not needed yet. More like laying foundation, and when needed can be enlarged.
} | ||
|
||
/// Create a new GlidePaths struct from string paths. | ||
pub fn from_file_path(glide_file: &str) -> Self { |
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.
Why is this needed?
} | ||
|
||
/// Create a new GlidePaths struct from string file name. | ||
pub fn from_file_name(file_name: &str) -> Self { |
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.
Why is this needed?
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.
This is how tests were built. The old implementation also had name options for tests.
I can remove it, but will need to refactor tests
|
||
/// Returns the path to the temporary directory where the socket file is stored. | ||
fn glide_sock_dir_path() -> PathBuf { | ||
let path = std::env::temp_dir() |
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.
GlidePaths
should have common API, like:
impl GlidePaths {
pub fn initialise() -> Result<(), io::Error> {
// Create the directory structures once
}
pub fn temp_dir() -> Option<&PathBuf> {
}
pub fn logs_dir() -> Option<&PathBuf> {
}
pub fn socket_file() -> Option<&PathBuf> {
/// Append the socket file name to the `Self::tmep_dir()`
}
}
#2985
#3226
Most of the changes are versions bump and the new rust edition fixes.
Relevant changes:
glide_pathes
Socket listener file
Adapted tests
Checklist
Before submitting the PR make sure the following are checked: