team-ljyzipelo

공개

다른 작업의 완료 결과 적용을 차단함

작성자
호시노 히나타
작성 시각
커밋
f6aa3879c4690ac63afd21ec231b460f42ae7aee
부모
d188493
이 시점의 파일 보기

변경된 파일 4개

+136-14
수정experiments/rust-ui-memory-app/src/controller.rs+29-5
@@ -27,6 +27,8 @@ pub struct Controller {
2727 pub task: Option<Task>,
2828 receiver: Option<core::Receiver>,
2929 pub terminal: Option<Completion>,
30추가: pub terminal_delivery: Option<core::Delivery>,
31추가: terminal_accepted: bool,
3032 pub close: CloseState,
3133 pub status: Status,
3234 pub generation: u64,
@@ -43,6 +45,8 @@ impl Default for Controller {
4345 task: None,
4446 receiver: None,
4547 terminal: None,
48추가: terminal_delivery: None,
49추가: terminal_accepted: false,
4650 close: CloseState::Open,
4751 status: Status::Idle,
4852 generation: 0,
@@ -81,6 +85,8 @@ impl Controller {
8185 self.generation = generation;
8286 self.selected = None;
8387 self.terminal = None;
88추가: self.terminal_delivery = None;
89추가: self.terminal_accepted = false;
8490 self.delivery_error = None;
8591 self.panic = None;
8692 self.spawn_error = None;
@@ -175,12 +181,30 @@ impl Controller {
175181 }
176182 }
177183 if let Some(completion) = &self.terminal {
178삭제: if let Err(error) = completion.outcome.validate(self.receiver.as_mut().unwrap()) {
179삭제: self.delivery_error.get_or_insert(error);
184추가: self.terminal_accepted = false;
185추가: match self
186추가: .receiver
187추가: .as_mut()
188추가: .map(|receiver| completion.outcome.validate(receiver))
189추가: {
190추가: Some(Ok(core::Delivery::Accepted)) => {
191추가: self.terminal_delivery = Some(core::Delivery::Accepted);
192추가: self.terminal_accepted = true;
193추가: }
194추가: Some(Ok(core::Delivery::IgnoredStale)) => {
195추가: self.terminal_delivery = Some(core::Delivery::IgnoredStale);
196추가: }
197추가: Some(Err(error)) => {
198추가: self.delivery_error.get_or_insert(error);
199추가: }
200추가: None => {}
180201 }
181202 self.status = if self.panic.is_some() {
182203 Status::Panicked
183삭제: } else if completion.delivery.is_some() || self.delivery_error.is_some() {
204추가: } else if !self.terminal_accepted
205추가: || completion.delivery.is_some()
206추가: || self.delivery_error.is_some()
207추가: {
184208 Status::DeliveryFailure
185209 } else if completion.outcome.is_ok() {
186210 Status::Completed
@@ -198,7 +222,7 @@ impl Controller {
198222 }
199223 }
200224 pub fn rows(&self) -> Vec<&str> {
201삭제: if self.status != Status::Completed {
225추가: if self.status != Status::Completed || !self.terminal_accepted {
202226 return Vec::new();
203227 }
204228 match self.terminal.as_ref().map(|c| &c.outcome) {
@@ -222,7 +246,7 @@ impl Controller {
222246 true
223247 }
224248 pub fn selected_bytes(&self) -> Option<&[u8]> {
225삭제: if self.status != Status::Completed {
249추가: if self.status != Status::Completed || !self.terminal_accepted {
226250 return None;
227251 }
228252 let (operation, generation, index) = self.selected?;
수정tests/rust-ui-memory-app/SHA256SUMS+3-3
@@ -3,11 +3,11 @@ d591ec67b8f1a1ea448b6bdd971e0b8c039a33a492c8f068b085bdd20b3a64ae experiments/ru
330714945e52a4d5b560c02c9a18478519f8c4e2572cbf87bd6d52adcfb2b63c62 experiments/rust-ui-memory-app/LICENSE
445b98107ae51806d6d4cb4337bea3b979f55070eba6dc7c0c294e13e7686ab4c6 experiments/rust-ui-memory-app/THIRD-PARTY-NOTICES.txt
551cddb84c6a8c5e4188be79220c92532351e51979d7ad0edbc0a12ac5381ed72c experiments/rust-ui-memory-app/src/app.rs
6삭제: fbe8d8f80267ac20ddd1cff47b5f75b14a680de4935e32472813183183a34019 experiments/rust-ui-memory-app/src/controller.rs
6추가: 51dc979b88e395c209444900511aa7d56bcc8ccc31205fca22191f25dc6468e2 experiments/rust-ui-memory-app/src/controller.rs
7758d303d44c6b8580168f14c3ceb0eb878fc7a003f197f162584286873a904ddc experiments/rust-ui-memory-app/src/lib.rs
88c1c1dde16263ea7ed4cf5808b3182e21878b8ffadfe8850974a8cbdbd4607b3f experiments/rust-ui-memory-app/src/runtime.rs
997aef227ed4424e13cfa750373a9e1f32bebae12308589c81d051f41ea84991ac experiments/rust-ui-memory-app/src/transport.rs
10삭제: d68f3ba20d8f392a2df38ac2faf785e197d023e86356c45eb7bebb7ce572c9e1 tests/rust-ui-memory-app/contract.json
10추가: 5a9a48f08dea0d3b103a359251bde06dd82e2568be02bdb905f5b0ceb7bb6dd9 tests/rust-ui-memory-app/contract.json
11115ee41a973a0e976fbb6fe36d4a3fcb0ed026e638e997042a0bef8c2f238f0599 tests/rust-ui-memory-app/dependencies.json
12128536779d3551eb86a82f4c8b814bb26ddeaff04f992d3e080ae06321f10e3453 tests/rust-ui-memory-app/dependency_audit.py
131397c0bc5c804d85fb523da4c76abff2bec3aed3ae1e02b68db1c19792e9843808 tests/rust-ui-memory-app/files.json
@@ -16,6 +16,6 @@ ce7c1973b4eab97e4e49257ce4dbc5cb35c5a1eaae7c666a04b548fe1fd41dba tests/rust-ui-
1616910cb4573b57fd26f122376f3f4eae0e4397163b83e32a3c850758d42f88dc55 tests/rust-ui-memory-app/fixtures/sample.tar
171709aca74cb3f20f1ed5b3e03fd647c80ef8e872f6ff97e17882cf2fda8b108b2c tests/rust-ui-memory-app/license-supplement.json
1818865d69b95660fefe8c9ad6129d2692cff8007ecc3d55de1a049fe162173f434d tests/rust-ui-memory-app/reference-ui.lock
19삭제: 3d6e73d481755bcf8d42f1574a5f4b669f38f9e5ae61ddfcfc4c55af07e6aace tests/rust-ui-memory-app/regressions.rs
19추가: 4eec2f9e036bc0fc04a1ff0af31aa28e593c185f8d1d230c8105a8fefc92fc4d tests/rust-ui-memory-app/regressions.rs
2020f6a7b3df44869c206ff517f32653885c5fcd2f335ef4e8eff94d6ab626ca4119 tests/rust-ui-memory-app/sources.json
21216a756de6da66731b1ea9eaaacedfbe32096bd6a918eab591a392bc45529184f5 tests/rust-ui-memory-app/static_check.py
수정tests/rust-ui-memory-app/contract.json+12-6
@@ -19,14 +19,16 @@
1919 "raw": "모든 checkpoint Event를 순번 변경 없이 try_send함. 최초 전달 실패 이후 suffix는 보내지 않고 first_missing_sequence로 시작 위치를 보존함. 원래 observer Err를 반환 우선순위로 유지하며 전달 실패는 별도임",
2020 "receiver": "원본 연속 stream을 PR42 Receiver로 검증함. 누락/중복 오류는 sticky로 보존하고 재생성하지 않음. terminal은 원형 보존하되 transport 오류가 있으면 payload 목록/내용에 적용하지 않음",
2121 "completion": "용량 1 별도 채널로 Terminal 소유 이동. Full/Disconnected이면 반환된 값을 작업 스레드 반환값으로 소유하여 join으로 회수함. 복제하지 않음",
22삭제: "mutex": "추가 공유 mutex를 사용하지 않아 자체 poison 경로 없음. 표준 채널 내부 구현 전체의 panic 회수를 주장하지 않음"
22추가: "mutex": "추가 공유 mutex를 사용하지 않아 자체 poison 경로 없음. 표준 채널 내부 구현 전체의 panic 회수를 주장하지 않음",
23추가: "terminal_acceptance": "Accepted만 실제 현재 결과의 완료/오류 분류와 payload 적용을 허용함. IgnoredStale는 원형 진단용 보존만 하며 현재 작업은 DeliveryFailure임. terminal 누락/Receiver 누락/검증 오류도 성공으로 처리하지 않음. payload 조회는 내부 accepted latch도 요구함"
2324 },
2425 "lifecycle": {
2526 "frame": "poll/try_recv/try_iter/is_finished만 사용하며 실행 중 join하지 않음. 완료 수신과 join 상태를 분리하고 원본 결과를 한 번 소유함",
2627 "close": "확인/취소 요청 후 대기/철회 구분. 철회해도 전송한 취소는 남음. 종료 확인 전 시작/재시작/실제 닫기 금지. 확인 중 먼저 완료돼도 선택은 유지함",
27삭제: "drop": "정상 GUI frame은 busy Task를 제거하지 않음. 비정상 owner 폐기의 Drop은 취소 요청 후 동기 join하여 조용한 detach를 피함. 이 비정상 fallback은 기다릴 수 있으며 비선점 callback/OOM/강제 프로세스 종료에서 유한 종료를 보장하지 않음",
28추가: "drop": "정상 GUI frame은 busy Task를 제거하지 않음. 비정상 소유권 폐기나 앱 종료에서 Task::Drop은 취소 요청 후 동기 join하므로 blocking할 수 있음. 비차단 보장은 정상 poll/닫기 전이 범위임. 강제 종료/비선점 callback/OOM에서 유한 종료나 안전한 회수를 보장하지 않음",
2829 "panic": "JoinError 원형을 별도로 소유하며 Terminal이나 cleanup 성공을 합성하지 않음",
29삭제: "cancel": "요청과 실제 native 반환을 구분함. 이미 완료된 성공을 뒤늦은 취소로 바꾸지 않음. 마지막 checkpoint와 Terminal 생성 사이 경합은 확정 검증하지 않음"
30추가: "cancel": "요청과 실제 native 반환을 구분함. 이미 완료된 성공을 뒤늦은 취소로 바꾸지 않음. 마지막 checkpoint와 Terminal 생성 사이 경합은 확정 검증하지 않음",
31추가: "normal_frame_regression": "gate로 실행 중인 스레드를 유지하고 poll/반복 시작/취소/닫기 확인/철회 뒤에도 같은 미join 핸들이 보존됨을 직접 회귀로 작성함. gate 해제 후 panic 종료와 명시적 poll_join을 확인함. 아직 실행하지 않았음"
3032 },
3133 "payload": {
3234 "ownership": "원본 typed Terminal이 bytes/목록/Usage/원래 오류를 소유함. GUI 문자열은 별도 제한된 표시임",
@@ -65,7 +67,7 @@
6567 },
6668 "validation": {
6769 "toolchain": "기존 Rust/Cargo/rustfmt 1.99.1 및 cache만 사용함",
68삭제: "rust_tests_declared": 28,
70추가: "rust_tests_declared": 31,
6971 "names": [
7072 "zip_default_queue_fits_without_ui_drain",
7173 "ustar_default_queue_fits_without_ui_drain",
@@ -94,7 +96,10 @@
9496 "oversized_queue_is_rejected_without_spawning",
9597 "gzip_preview_preserves_original_bytes",
9698 "ui_event_wrapper_excludes_old_operation_before_current_sequence",
97삭제: "native_gzip_callback_error_survives_simultaneous_queue_full"
99추가: "native_gzip_callback_error_survives_simultaneous_queue_full",
100추가: "controller_rejects_real_foreign_terminal_without_applying_payload",
101추가: "joined_task_without_received_terminal_is_delivery_failure",
102추가: "normal_frame_controls_retain_running_handle_until_explicit_join"
98103 ],
99104 "rust_tests_compiled": false,
100105 "rust_tests_discovered": false,
@@ -105,7 +110,8 @@
105110 "headless_lib": "Linux locked/offline exit 0",
106111 "gui": "Linux ui feature binary locked/offline exit 0",
107112 "rustfmt": "1.99.1 check exit 0",
108삭제: "metadata": "Linux headless/GUI locked/offline exit 0. Windows 두 target headless/GUI 선택 감사 완료. 미캐시 iOS를 포함한 무필터 metadata는 offline 실패로 보존함"
113추가: "metadata": "Linux headless/GUI locked/offline exit 0. Windows 두 target headless/GUI 선택 감사 완료. 미캐시 iOS를 포함한 무필터 metadata는 offline 실패로 보존함",
114추가: "previous_head": "d188493ff6b82f4aef4c648405be07316da36eb0의 빌드와 이번 보완 source 빌드는 별도 로그로 구분함"
109115 }
110116 },
111117 "preservation": "새 두 디렉터리만 추가함. 기존 core/60개 원본/PR34/39/main/C# 수정 없음. 공유 로컬 Git 브랜치 전환/스테이징 없음"
수정tests/rust-ui-memory-app/regressions.rs+92-0
@@ -419,3 +419,95 @@ fn native_gzip_callback_error_survives_simultaneous_queue_full() {
419419 assert!(terminal.cancellation_requested());
420420 assert!(!terminal.cancellation_forwarded());
421421}
422추가:
423추가: #[test]
424추가: fn controller_rejects_real_foreign_terminal_without_applying_payload() {
425추가: let (foreign, _) = core::Operation::start().unwrap();
426추가: let (sender, _events) = mpsc::sync_channel(DEFAULT_CAPACITY);
427추가: let foreign_terminal = runtime::execute(foreign, Action::Gzip, sender);
428추가: assert!(foreign_terminal.outcome.is_ok());
429추가: let mut c = Controller::default();
430추가: assert!(c.start(Action::Gzip));
431추가: finish(c.task.as_ref().unwrap());
432추가: c.terminal = Some(foreign_terminal);
433추가: c.poll();
434추가: assert_eq!(c.terminal_delivery, Some(core::Delivery::IgnoredStale));
435추가: assert_eq!(c.status, Status::DeliveryFailure);
436추가: assert!(c.rows().is_empty());
437추가: assert!(!c.select(c.task.as_ref().unwrap().id, c.generation, 0));
438추가: assert!(c.selected_bytes().is_none());
439추가: assert!(c.terminal.as_ref().unwrap().outcome.is_ok());
440추가: assert!(c.task.as_ref().unwrap().joined());
441추가: }
442추가:
443추가: #[test]
444추가: fn joined_task_without_received_terminal_is_delivery_failure() {
445추가: let mut c = Controller::default();
446추가: assert!(c.start(Action::Gzip));
447추가: finish(c.task.as_ref().unwrap());
448추가: let withheld = c
449추가: .task
450추가: .as_ref()
451추가: .unwrap()
452추가: .completion
453추가: .as_ref()
454추가: .unwrap()
455추가: .try_recv()
456추가: .unwrap();
457추가: assert!(withheld.outcome.is_ok());
458추가: c.poll();
459추가: assert_eq!(c.status, Status::DeliveryFailure);
460추가: assert!(c.terminal.is_none());
461추가: assert!(c.terminal_delivery.is_none());
462추가: assert!(c.rows().is_empty());
463추가: assert!(c.selected_bytes().is_none());
464추가: }
465추가:
466추가: #[test]
467추가: fn normal_frame_controls_retain_running_handle_until_explicit_join() {
468추가: use std::sync::{
469추가: Arc,
470추가: atomic::{AtomicBool, Ordering},
471추가: };
472추가: struct RunningProbe(Arc<AtomicBool>);
473추가: impl Drop for RunningProbe {
474추가: fn drop(&mut self) {
475추가: self.0.store(true, Ordering::SeqCst);
476추가: }
477추가: }
478추가: let dropped = Arc::new(AtomicBool::new(false));
479추가: let worker_probe = dropped.clone();
480추가: let (ready, entered) = mpsc::sync_channel(1);
481추가: let (release, gate) = mpsc::sync_channel(1);
482추가: let task = Task::spawn_with(DEFAULT_CAPACITY, move |_, _| {
483추가: let _probe = RunningProbe(worker_probe);
484추가: ready.try_send(()).unwrap();
485추가: gate.recv_timeout(Duration::from_secs(5)).unwrap();
486추가: panic!("수명 회귀의 종료 경로");
487추가: })
488추가: .unwrap();
489추가: entered.recv_timeout(Duration::from_secs(5)).unwrap();
490추가: let id = task.id;
491추가: let mut c = Controller::default();
492추가: c.task = Some(task);
493추가: c.poll();
494추가: assert!(!c.start(Action::Zip));
495추가: assert!(c.cancel());
496추가: c.request_close();
497추가: c.confirm_close();
498추가: assert_eq!(c.close, CloseState::Waiting);
499추가: c.poll();
500추가: c.keep_open();
501추가: c.poll();
502추가: assert!(c.busy());
503추가: assert_eq!(c.task.as_ref().unwrap().id, id);
504추가: assert!(!c.task.as_ref().unwrap().joined());
505추가: assert!(!dropped.load(Ordering::SeqCst));
506추가: release.try_send(()).unwrap();
507추가: finish(c.task.as_ref().unwrap());
508추가: c.poll();
509추가: assert!(dropped.load(Ordering::SeqCst));
510추가: assert!(c.task.as_ref().unwrap().joined());
511추가: assert_eq!(c.status, Status::Panicked);
512추가: assert_eq!(c.close, CloseState::Open);
513추가: }