-
Notifications
You must be signed in to change notification settings - Fork 38
Conversation
b76c2f1
to
cec7108
Compare
73a6d75
to
1a3cd5d
Compare
1a3cd5d
to
d132025
Compare
d132025
to
797f9aa
Compare
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.
Overall LGTM, I think we should merged then do the follow ups in another PR to avoid conflicts.
continue; | ||
}; | ||
let socket: Box<dyn Conn> = Box::new(conn); | ||
let _: Result<_, _> = accept_tx.send(Accept { socket, peer_addr }).await; |
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.
Should we close the acceptor if the other end has disappeared?
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.
Which acceptor are you referring to?
sqld/src/http/mod.rs
Outdated
pub auth: Arc<Auth>, | ||
pub http_acceptor: Option<A>, | ||
pub hrana_ws_acceptor: Option<A>, | ||
pub namespaces: NamespaceStore<M>, | ||
pub idle_shutdown_kicker: Option<IdleShutdownKicker>, | ||
pub stats: Stats, | ||
pub proxy_service: P, | ||
pub replication_service: S, | ||
pub disable_default_namespace: bool, | ||
pub disable_namespaces: bool, | ||
pub max_response_size: u64, | ||
pub enable_console: bool, | ||
pub self_url: Option<String>, | ||
pub join_set: &'a mut JoinSet<anyhow::Result<()>>, |
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.
Is it possible to avoid all these pub? I think this just makes refactoring code later on really hard since these items leak pretty easily.
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.
What would you suggest?
pub struct Server<C = HttpConnector, A = AddrIncoming> { | ||
pub path: Arc<Path>, | ||
pub db_config: DbConfig, | ||
pub user_api_config: UserApiConfig<A>, |
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 we should call it HttpServer
(matches the mod) and RpcServer
(like you have already). I think that reads the best.
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.
Idk, it's not only an HTTP server, if anything, it's a SqldServer
, but since we're changing the name, I avoid including sqld into anything. Any other ideas?
86fc033
to
3166f30
Compare
@LucioFranco, merging this to move forward, I can address your points in followups if you want. |
This PR aims to abstract networking for sqld so that we can simulate it and start writing tests using turmoil for network simulation.
I took the opportunity to clean up the configuration process and remove useless stuff that accumulated with time.
The
--backend
flag was removed because it is unused.The
net
module contains network abstractions used throughout the crate.