Repository navigation
INTERNAL: Close the lanes, finishing the job each runs - #24
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
e711a97 to
51dbe49
Compare
51dbe49 to
b2b701d
Compare
b2b701d to
ac74c8a
Compare
ac74c8a to
d7e56a0
Compare
d7e56a0 to
1473bee
Compare
72aa82f to
df59c56
Compare
1473bee to
fb39e69
Compare
fb39e69 to
482bd97
Compare
482bd97 to
8a07842
Compare
dba1e98 to
d37773c
Compare
d37773c to
62fe504
Compare
1d0afc9 to
bf83e9a
Compare
62fe504 to
9cc4121
Compare
9cc4121 to
2002aa4
Compare
5ff9bb9 to
813cb24
Compare
813cb24 to
74f70ba
Compare
74f70ba to
9370bc6
Compare
9370bc6 to
4d97960
Compare
4d97960 to
c18a3c8
Compare
62e5b40 to
68326a5
Compare
30bfea7 to
6d814d5
Compare
zhy2on
left a comment
There was a problem hiding this comment.
nit는 참고용으로 남겼습니다. 수정하지 않으셔도 될 것 같습니다.
| .then_some(Cow::Borrowed(&b"DROPPED\r\n"[..])) | ||
| .ok_or(Error::NotFound), | ||
| // A lane ends on it before it runs. | ||
| Op::Shutdown => Err(Error::Internal), |
There was a problem hiding this comment.
nit: Shutdown이 Op에 들어가면서, 실제로는 쓰이지 않는 ops::run의 Shutdown 처리와 lane()의 Option이 생긴 것 같습니다.
아래처럼 Shutdown을 따로 두면 이 코드는 필요 없어질 것 같습니다.
enum Msg {
Task(Task),
Shutdown,
}다만 Task를 한 번 더 감싸야 해서 오히려 복잡해질 수도 있을 것 같습니다.
There was a problem hiding this comment.
아마 추후 리팩토링에서 Op라는 이름 대신에 Job 같은 이름으로 변경할 것 같습니다.
참고해주시면 좋을 것 같습니다.
| /// Has each lane end once the job it runs is done; the queued ones drop unrun, waking their | ||
| /// connections to an internal error. Does not wait for the lanes to end. | ||
| #[expect(dead_code, reason = "nothing closes the lanes yet")] | ||
| pub fn shutdown() { | ||
| // SAFETY: a non-null `POOL` is a leaked array, never freed. | ||
| if let Some(lanes) = unsafe { POOL.load(Ordering::Acquire).as_ref() } { | ||
| lanes.iter().for_each(close); | ||
| } | ||
| } |
There was a problem hiding this comment.
abort는 클라이언트 연결이 종료될 때 불리는 콜백이라 lane을 닫으면 안 된다고 하는데, 아닌가요?
There was a problem hiding this comment.
abort는 클라이언트 연결이 종료될 때 불리는 콜백이라 lane을 닫으면 안 된다고 하는데, 아닌가요?
PR 코멘트를 수정을 안 해놓았습니다.
abort는 클라이언트 연결이 종료될 때 불리는 게 맞으며, 현재는 abort에서 레인을 종료하는 로직은 이미 없는 상태입니다.
| // A lane ends on it before it runs. | ||
| Op::Shutdown => Err(Error::Internal), |
There was a problem hiding this comment.
아마 이 부분은 나중에 로그만 남기는 걸로 변경할 것 같습니다.
Op::Search => ...
Op::Replace => ...
...
_ => warn("Arcus Vector: An unexpected task was received.")
namsic
left a comment
There was a problem hiding this comment.
이후 구현에 의존하거나 리팩토링에서 다시 변경될 코드라서, PR 하나하나 확인할 필요가 크지 않아 보여 approve 합니다. 마지막에 다시 확인하는 것으로 하겠습니다.
6d814d5 to
c5665e8
Compare
c5665e8 to
072a5ed
Compare
🔗 Related Issue
⌨️ What I did
lane들을 닫는
pool::shutdown()을 추가합니다.동작