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 +4 -4
- data/Cargo.lock +1 -1
- data/ext/itsi_scheduler/Cargo.toml +1 -1
- data/ext/itsi_server/Cargo.toml +1 -1
- data/ext/itsi_server/src/ruby_types/itsi_grpc_call.rs +0 -1
- data/ext/itsi_server/src/ruby_types/itsi_http_response.rs +19 -4
- data/ext/itsi_server/src/server/signal.rs +14 -9
- data/lib/itsi/scheduler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a0310b5d87ea2c3470072d73ecf16b17f142e4d89c90faef85da892cf537420e
|
|
4
|
+
data.tar.gz: 21b6f1547c67d8196801d50753733bfbb5cf170ea78369e89e52dad565be1c2e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90cf9db2efe51b31f8b240f0cb53575d2e6587a3aa8df6ac4d2266ab5448fb5d5cafb339c8e1c3c33cf11ce374f77eccda82719ff80abff0e1be57f1e9c649e9
|
|
7
|
+
data.tar.gz: 9c0560308e78f59180a213df62b9c57948cf9a97b21a7f5845d814d1830465a16cf393767f5f892fc1afa34b7982efc1020e4997ad3e4beb62a89e7c927803da
|
data/Cargo.lock
CHANGED
data/ext/itsi_server/Cargo.toml
CHANGED
|
@@ -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(
|
|
102
|
-
|
|
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(
|
|
107
|
-
|
|
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
|
|
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
|
-
|
|
106
|
-
libc::signal(libc::
|
|
107
|
-
libc::signal(libc::
|
|
108
|
-
libc::signal(libc::
|
|
109
|
-
libc::signal(libc::
|
|
110
|
-
libc::signal(libc::
|
|
111
|
-
libc::signal(libc::
|
|
112
|
-
libc::signal(libc::
|
|
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
|
}
|
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
|
|
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-
|
|
11
|
+
date: 2026-06-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rb_sys
|