• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / edge-runtime / 17229631411

26 Aug 2025 06:13AM UTC coverage: 51.84% (-2.1%) from 53.937%
17229631411

push

github

web-flow
fix: remove another bottleneck that causes boot time spike (#596)

* fix: remove another bottleneck that causes boot time spike

* chore: add integration test

28 of 33 new or added lines in 1 file covered. (84.85%)

4922 existing lines in 74 files now uncovered.

18444 of 35579 relevant lines covered (51.84%)

5545.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

7.69
/ext/node/ops/process.rs
1
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2

3
use deno_core::op2;
4
use deno_core::OpState;
5
use deno_permissions::PermissionsContainer;
6

7
#[cfg(unix)]
UNCOV
8
fn kill(pid: i32, sig: i32) -> i32 {
×
UNCOV
9
  // SAFETY: FFI call to libc
×
UNCOV
10
  if unsafe { libc::kill(pid, sig) } < 0 {
×
UNCOV
11
    std::io::Error::last_os_error().raw_os_error().unwrap()
×
12
  } else {
UNCOV
13
    0
×
14
  }
UNCOV
15
}
×
16

17
#[cfg(not(unix))]
18
fn kill(pid: i32, _sig: i32) -> i32 {
19
  use winapi::shared::minwindef::DWORD;
20
  use winapi::shared::minwindef::FALSE;
21
  use winapi::shared::minwindef::TRUE;
22
  use winapi::um::errhandlingapi::GetLastError;
23
  use winapi::um::processthreadsapi::GetCurrentProcess;
24
  use winapi::um::processthreadsapi::OpenProcess;
25
  use winapi::um::processthreadsapi::TerminateProcess;
26
  use winapi::um::winnt::PROCESS_TERMINATE;
27

28
  // SAFETY: FFI call to winapi
29
  unsafe {
30
    let p_hnd = if pid == 0 {
31
      GetCurrentProcess()
32
    } else {
33
      OpenProcess(PROCESS_TERMINATE, FALSE, pid as DWORD)
34
    };
35

36
    if p_hnd.is_null() {
37
      return GetLastError() as i32;
38
    }
39

40
    if TerminateProcess(p_hnd, 1) == TRUE {
41
      return 0;
42
    }
43

44
    GetLastError() as i32
45
  }
46
}
47

48
#[op2(fast, stack_trace)]
1,159✔
49
pub fn op_node_process_kill(
×
50
  state: &mut OpState,
×
51
  #[smi] pid: i32,
×
UNCOV
52
  #[smi] sig: i32,
×
53
) -> Result<i32, deno_core::error::AnyError> {
×
54
  state
×
UNCOV
55
    .borrow_mut::<PermissionsContainer>()
×
UNCOV
56
    .check_run_all("process.kill")?;
×
UNCOV
57
  Ok(kill(pid, sig))
×
UNCOV
58
}
×
59

60
#[op2(fast)]
1,159✔
UNCOV
61
pub fn op_process_abort(state: &mut OpState) {
×
UNCOV
62
  if state
×
UNCOV
63
    .borrow_mut::<PermissionsContainer>()
×
UNCOV
64
    .check_run_all("process.abort")
×
UNCOV
65
    .is_ok()
×
66
  {
UNCOV
67
    std::process::abort();
×
UNCOV
68
  }
×
UNCOV
69
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc