Commit graph

17 commits

Author SHA1 Message Date
Claude
2294f52407
fix: guard JobObject setup with Once and check return values
CreateJobObjectA / SetInformationJobObject / AssignProcessToJobObject
were called inside the per-start thread and their return values were
ignored. Two consequences:

1. Each server crash-restart created a fresh kernel JobObject HANDLE
   that was never CloseHandle'd. The HANDLE went out of scope when the
   spawned thread exited, leaking a kernel object every crash.
2. On Win 7/8 (single-job systems) and inside parent jobs that disallow
   breakaway, AssignProcessToJobObject silently failed, so
   stremio-runtime could survive the shell's death and hold port 11470.

Hoist the setup into ensure_parent_job_object() guarded by sync::Once
so it runs exactly once per shell process, and check each return value
explicitly with a clear log message when the OS-level safety net is
degraded. The HANDLE is intentionally not closed: closing it while
KILL_ON_JOB_CLOSE is set would terminate the shell itself.

Closes #47
Closes #48
2026-05-10 14:43:06 +00:00
Claude
a9d9673f2a
fix: break server reader threads on read error
stdout.read(...).unwrap_or(!0) substituted usize::MAX on Err, then
`if on > buffer.len() { continue; }` swallowed it and looped back into
read(). On a sticky IO error (broken pipe, EBADF) the thread spun a
CPU core forever and the accumulated logs were never flushed.

Match Ok(0)/Ok(n)/Err(e) explicitly: break on EOF, break on error after
logging, and treat any other Ok(n) as bytes read. Same change for
stderr.

Closes #51
2026-05-10 12:32:20 +00:00
Vladimir Borisov
b37fbbd4c8
64 bit build 2025-06-30 12:39:12 +03:00
Vladimir Borisov
03921ffce9
Clippy 2025-01-21 11:53:38 +02:00
Vladimir Borisov
8e1b72d513
Server crash logs and boot availability 2025-01-21 11:45:14 +02:00
Vladimir Borisov
4622458f6f Use constant from winapi crate 2024-04-22 15:12:32 +03:00
Vladimir Borisov
b8c68029ed Execute the server from the same directory the main executable is 2024-04-22 12:53:53 +03:00
Vladimir Borisov
e88653974b Fix autoupdater 2024-04-19 18:44:33 +03:00
Vladimir Borisov
c8fbba0a62 Updated dependencies. Fixed errors 2024-03-07 17:38:43 +02:00
Vladimir Borisov
eeab2bb072 Remove unused import 2022-09-30 15:55:51 +03:00
Vladimir Borisov
b85cf31cd1 Slightly better error handling for the server 2022-09-30 15:51:59 +03:00
Vladimir Borisov
7827832670 Update server.js to 4.4.159 2022-09-29 18:19:23 +03:00
Vladimir Borisov
7a7494f726 Use Windows line endings for easier diff 2022-04-08 09:16:46 +03:00
Martin Kavík
f10380f60a minor refactor + cargo fmt --all 2022-04-01 22:47:02 +02:00
Vladimir Borisov
76ff6cac5b Better way to hide the terminal 2021-11-17 11:24:25 +02:00
Vladimir Borisov
12a44b0ff6 Run server as win32 job 2021-08-02 16:10:11 +03:00
Vladimir Borisov
e6cb1d8fa6 Renamed files. Clippy is happy 2021-07-26 14:07:04 +03:00
Renamed from src/stremio_app/stremio_server/stremio_server.rs (Browse further)