itsi-scheduler 0.2.27.rc1 → 0.2.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da3ff323e8346024c5c732ecf1d6efb3012f69747e714e0860d9363f598ba1f4
4
- data.tar.gz: 7269985025a2a29f8a098cfba12f81411fdf348ca966f5352cee8e2abff48719
3
+ metadata.gz: a0310b5d87ea2c3470072d73ecf16b17f142e4d89c90faef85da892cf537420e
4
+ data.tar.gz: 21b6f1547c67d8196801d50753733bfbb5cf170ea78369e89e52dad565be1c2e
5
5
  SHA512:
6
- metadata.gz: efa99c2d6051dea7f5ea6cb3766f9fc951ab8a02d18e18563dfbe2a856014b7226870de7cb6e968f807ac663964e2bedde73bf887fb5bb64f6242294e628f046
7
- data.tar.gz: a431b7d7e1baa23b64490914cf006fb6346055a969a9d5a6c5e03967ff8e5279d8d65aa9a7b0520273178561843dd33d0a5b14457e6f233ddd131c34cdb24107
6
+ metadata.gz: 90cf9db2efe51b31f8b240f0cb53575d2e6587a3aa8df6ac4d2266ab5448fb5d5cafb339c8e1c3c33cf11ce374f77eccda82719ff80abff0e1be57f1e9c649e9
7
+ data.tar.gz: 9c0560308e78f59180a213df62b9c57948cf9a97b21a7f5845d814d1830465a16cf393767f5f892fc1afa34b7982efc1020e4997ad3e4beb62a89e7c927803da
data/Cargo.lock CHANGED
@@ -211,7 +211,7 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
211
211
 
212
212
  [[package]]
213
213
  name = "itsi-scheduler"
214
- version = "0.2.27-rc1"
214
+ version = "0.2.27"
215
215
  dependencies = [
216
216
  "bytes",
217
217
  "derive_more",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "itsi-scheduler"
3
- version = "0.2.27-rc1"
3
+ version = "0.2.27"
4
4
  edition = "2021"
5
5
  authors = ["Wouter Coppieters <wc@pico.net.nz>"]
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "itsi-server"
3
- version = "0.2.27-rc1"
3
+ version = "0.2.27"
4
4
  edition = "2021"
5
5
  authors = ["Wouter Coppieters <wc@pico.net.nz>"]
6
6
  license = "MIT"
@@ -11,7 +11,6 @@ use http::{request::Parts, Response, StatusCode};
11
11
  use http_body_util::BodyExt;
12
12
  use itsi_error::CLIENT_CONNECTION_CLOSED;
13
13
  use itsi_rb_helpers::{print_rb_backtrace, HeapValue};
14
- use itsi_tracing::debug;
15
14
  use magnus::{
16
15
  block::Proc,
17
16
  error::{ErrorType, Result as MagnusResult},
@@ -72,6 +72,17 @@ pub enum ResponseFrame {
72
72
  }
73
73
 
74
74
  impl ItsiHttpResponse {
75
+ fn is_expected_bridge_shutdown(err: &io::Error) -> bool {
76
+ matches!(
77
+ err.kind(),
78
+ io::ErrorKind::BrokenPipe
79
+ | io::ErrorKind::ConnectionAborted
80
+ | io::ErrorKind::ConnectionReset
81
+ | io::ErrorKind::NotConnected
82
+ | io::ErrorKind::UnexpectedEof
83
+ )
84
+ }
85
+
75
86
  pub fn new(
76
87
  parts: Arc<Parts>,
77
88
  response_sender: OneshotSender<ResponseFrame>,
@@ -98,13 +109,17 @@ impl ItsiHttpResponse {
98
109
  let (mut cr, mut cw) = tokio::io::split(client_io);
99
110
 
100
111
  let to_ruby = tokio::spawn(async move {
101
- if let Err(e) = tokio::io::copy(&mut cr, &mut lw).await {
102
- eprintln!("Error copying upgraded->local: {:?}", e);
112
+ if let Err(err) = tokio::io::copy(&mut cr, &mut lw).await {
113
+ if !Self::is_expected_bridge_shutdown(&err) {
114
+ eprintln!("Error copying upgraded->local: {:?}", err);
115
+ }
103
116
  }
104
117
  });
105
118
  let from_ruby = tokio::spawn(async move {
106
- if let Err(e) = tokio::io::copy(&mut lr, &mut cw).await {
107
- eprintln!("Error copying upgraded->local: {:?}", e);
119
+ if let Err(err) = tokio::io::copy(&mut lr, &mut cw).await {
120
+ if !Self::is_expected_bridge_shutdown(&err) {
121
+ eprintln!("Error copying local->upgraded: {:?}", err);
122
+ }
108
123
  }
109
124
  });
110
125
 
@@ -63,7 +63,7 @@ pub fn send_lifecycle_event(event: LifecycleEvent) {
63
63
  }
64
64
  }
65
65
 
66
- fn receive_signal(signum: i32, _: sighandler_t) {
66
+ extern "C" fn receive_signal(signum: i32) {
67
67
  debug!("Received signal: {}", signum);
68
68
  SIGINT_COUNT.fetch_add(-1, Ordering::SeqCst);
69
69
  let event = match signum {
@@ -96,20 +96,25 @@ fn receive_signal(signum: i32, _: sighandler_t) {
96
96
  }
97
97
  }
98
98
 
99
+ fn signal_handler() -> sighandler_t {
100
+ receive_signal as *const () as sighandler_t
101
+ }
102
+
99
103
  pub fn reset_signal_handlers() -> bool {
100
104
  debug!("Resetting signal handlers");
101
105
  SIGINT_COUNT.store(0, Ordering::SeqCst);
102
106
  SHUTDOWN_REQUESTED.store(false, Ordering::SeqCst);
103
107
 
104
108
  unsafe {
105
- libc::signal(libc::SIGTERM, receive_signal as usize);
106
- libc::signal(libc::SIGINT, receive_signal as usize);
107
- libc::signal(libc::SIGUSR2, receive_signal as usize);
108
- libc::signal(libc::SIGUSR1, receive_signal as usize);
109
- libc::signal(libc::SIGHUP, receive_signal as usize);
110
- libc::signal(libc::SIGTTIN, receive_signal as usize);
111
- libc::signal(libc::SIGTTOU, receive_signal as usize);
112
- libc::signal(libc::SIGCHLD, receive_signal as usize);
109
+ let handler = signal_handler();
110
+ libc::signal(libc::SIGTERM, handler);
111
+ libc::signal(libc::SIGINT, handler);
112
+ libc::signal(libc::SIGUSR2, handler);
113
+ libc::signal(libc::SIGUSR1, handler);
114
+ libc::signal(libc::SIGHUP, handler);
115
+ libc::signal(libc::SIGTTIN, handler);
116
+ libc::signal(libc::SIGTTOU, handler);
117
+ libc::signal(libc::SIGCHLD, handler);
113
118
  }
114
119
  true
115
120
  }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Itsi
4
4
  class Scheduler
5
- VERSION = "0.2.27.rc1"
5
+ VERSION = "0.2.27"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itsi-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.27.rc1
4
+ version: 0.2.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter Coppieters
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-06-14 00:00:00.000000000 Z
11
+ date: 2026-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys