Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix sigterm issue with translator sv2 #1319

Merged

Conversation

Shourya742
Copy link
Contributor

Partially closes: #1266

The issue lies with the blocking nature of self.internal_start().await inside the loop. Since the .await suspends the current task, it prevents the tokio::select! from responding promptly to other events, such as the ctrl_c() signal. This PR tends to spawn to internal_start as a separate task, while still keeping the select! macro active to listen for other events.

Copy link
Contributor

github-actions bot commented Dec 23, 2024

🐰 Bencher Report

Branch2024-12-23-fix-sigterm-translator-sv2
Testbedsv2
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
client_sv2_handle_message_common📈 view plot
🚷 view threshold
44.34
(-2.46%)
62.09
(71.41%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
74.46
(-1.35%)
98.45
(75.63%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
14.65
(-0.06%)
14.72
(99.55%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
262.36
(-0.27%)
285.76
(91.81%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
622.77
(+0.33%)
684.65
(90.96%)
client_sv2_open_channel📈 view plot
🚷 view threshold
164.30
(-0.89%)
179.83
(91.36%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
283.75
(-1.03%)
318.68
(89.04%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
382.12
(-0.18%)
399.03
(95.76%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
165.05
(+2.88%)
172.47
(95.70%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
449.97
(-3.77%)
552.70
(81.41%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
983.64
(-2.92%)
1,248.71
(78.77%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Dec 23, 2024

🐰 Bencher Report

Branch2024-12-23-fix-sigterm-translator-sv2
Testbedsv2

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
client_sv2_handle_message_commonRAM Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
42.00
(+8.52%)
41.92
(100.20%)
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
1e3 x estimated cycles
(Result Δ%)
Upper Boundary
1e3 x estimated cycles
(Limit %)
InstructionsBenchmark Result
instructions
(Result Δ%)
Upper Boundary
instructions
(Limit %)
L1 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
L2 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
RAM AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
client_sv2_handle_message_common📈 view plot
🚷 view threshold
2.23
(+5.42%)
2.24
(99.43%)
📈 view plot
🚷 view threshold
473.00
(-0.14%)
490.49
(96.43%)
📈 view plot
🚷 view threshold
731.00
(-0.68%)
758.92
(96.32%)
📈 view plot
🚷 view threshold
6.00
(+16.72%)
11.61
(51.69%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
42.00
(+8.52%)
41.92
(100.20%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
8.32
(+1.14%)
8.40
(99.04%)
📈 view plot
🚷 view threshold
2,137.00📈 view plot
🚷 view threshold
3,152.00
(-0.21%)
3,167.46
(99.51%)
📈 view plot
🚷 view threshold
40.00
(+12.23%)
41.66
(96.02%)
📈 view plot
🚷 view threshold
142.00
(+1.62%)
144.63
(98.18%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
6.42
(+1.86%)
6.45
(99.49%)
📈 view plot
🚷 view threshold
1,750.00
(-0.04%)
1,767.49
(99.01%)
📈 view plot
🚷 view threshold
2,546.00
(-0.23%)
2,575.35
(98.86%)
📈 view plot
🚷 view threshold
19.00
(+10.65%)
24.04
(79.04%)
📈 view plot
🚷 view threshold
108.00
(+3.11%)
108.92
(99.15%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
14.88
(+1.06%)
14.94
(99.61%)
📈 view plot
🚷 view threshold
4,694.00
(-0.01%)
4,711.49
(99.63%)
📈 view plot
🚷 view threshold
6,744.00
(-0.17%)
6,786.77
(99.37%)
📈 view plot
🚷 view threshold
53.00
(+15.39%)
63.46
(83.52%)
📈 view plot
🚷 view threshold
225.00
(+1.72%)
226.26
(99.44%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
27.86
(+0.90%)
28.07
(99.23%)
📈 view plot
🚷 view threshold
10,645.00
(+0.35%)
10,700.14
(99.48%)
📈 view plot
🚷 view threshold
15,501.00
(+0.38%)
15,596.58
(99.39%)
📈 view plot
🚷 view threshold
91.00
(+8.43%)
99.35
(91.59%)
📈 view plot
🚷 view threshold
340.00
(+1.31%)
343.35
(99.02%)
client_sv2_open_channel📈 view plot
🚷 view threshold
4.51
(+2.49%)
4.59
(98.37%)
📈 view plot
🚷 view threshold
1,461.00
(-0.05%)
1,478.49
(98.82%)
📈 view plot
🚷 view threshold
2,155.00
(-0.26%)
2,184.67
(98.64%)
📈 view plot
🚷 view threshold
10.00
(+21.44%)
14.00
(71.44%)
📈 view plot
🚷 view threshold
66.00
(+4.83%)
67.97
(97.10%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
14.13
(+0.78%)
14.21
(99.47%)
📈 view plot
🚷 view threshold
5,064.00
(-0.01%)
5,081.49
(99.66%)
📈 view plot
🚷 view threshold
7,320.00
(-0.08%)
7,352.73
(99.55%)
📈 view plot
🚷 view threshold
39.00
(+6.10%)
48.34
(80.67%)
📈 view plot
🚷 view threshold
189.00
(+1.60%)
190.96
(98.98%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
22.89
(+0.77%)
23.08
(99.17%)
📈 view plot
🚷 view threshold
8,040.00
(+0.09%)
8,057.61
(99.78%)
📈 view plot
🚷 view threshold
11,688.00
(+0.03%)
11,713.51
(99.78%)
📈 view plot
🚷 view threshold
84.00
(+10.62%)
90.02
(93.31%)
📈 view plot
🚷 view threshold
308.00
(+1.25%)
312.97
(98.41%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
4.78
(+1.83%)
4.80
(99.64%)
📈 view plot
🚷 view threshold
1,502.00
(-0.04%)
1,519.49
(98.85%)
📈 view plot
🚷 view threshold
2,274.00
(-0.21%)
2,300.86
(98.83%)
📈 view plot
🚷 view threshold
11.00
(+16.36%)
15.26
(72.07%)
📈 view plot
🚷 view threshold
70.00
(+3.50%)
70.28
(99.61%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
16.32
(+0.97%)
16.34
(99.88%)
📈 view plot
🚷 view threshold
5,963.00
(-0.01%)
5,980.49
(99.71%)
📈 view plot
🚷 view threshold
8,651.00
(-0.15%)
8,692.74
(99.52%)
📈 view plot
🚷 view threshold
49.00
(+19.97%)
56.50
(86.73%)
📈 view plot
🚷 view threshold
212.00
(+1.77%)
212.36
(99.83%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
35.81
(+0.56%)
35.96
(99.57%)
📈 view plot
🚷 view threshold
14,888.00
(+0.13%)
14,920.01
(99.79%)
📈 view plot
🚷 view threshold
21,868.00
(+0.11%)
21,919.56
(99.76%)
📈 view plot
🚷 view threshold
107.00
(+12.86%)
120.21
(89.01%)
📈 view plot
🚷 view threshold
383.00
(+0.88%)
385.85
(99.26%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Dec 23, 2024

🐰 Bencher Report

Branch2024-12-23-fix-sigterm-translator-sv2
Testbedsv1
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
1e3 x estimated cycles
(Result Δ%)
Upper Boundary
1e3 x estimated cycles
(Limit %)
InstructionsBenchmark Result
1e3 x instructions
(Result Δ%)
Upper Boundary
1e3 x instructions
(Limit %)
L1 AccessesBenchmark Result
1e3 x accesses
(Result Δ%)
Upper Boundary
1e3 x accesses
(Limit %)
L2 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
RAM AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
get_authorize📈 view plot
🚷 view threshold
8.39
(-0.70%)
8.67
(96.80%)
📈 view plot
🚷 view threshold
3.69
(-0.92%)
3.86
(95.54%)
📈 view plot
🚷 view threshold
5.16
(-1.08%)
5.45
(94.65%)
📈 view plot
🚷 view threshold
11.00
(+28.70%)
16.47
(66.77%)
📈 view plot
🚷 view threshold
91.00
(-0.48%)
96.80
(94.01%)
get_submit📈 view plot
🚷 view threshold
95.19
(-0.18%)
95.62
(99.55%)
📈 view plot
🚷 view threshold
59.35
(-0.09%)
59.71
(99.39%)
📈 view plot
🚷 view threshold
85.22
(-0.10%)
85.82
(99.30%)
📈 view plot
🚷 view threshold
47.00
(+4.64%)
60.46
(77.73%)
📈 view plot
🚷 view threshold
278.00
(-0.98%)
291.88
(95.24%)
get_subscribe📈 view plot
🚷 view threshold
7.88
(-1.40%)
8.23
(95.75%)
📈 view plot
🚷 view threshold
2.77
(-1.63%)
2.94
(93.98%)
📈 view plot
🚷 view threshold
3.85
(-1.92%)
4.14
(92.83%)
📈 view plot
🚷 view threshold
16.00
(+26.73%)
20.95
(76.39%)
📈 view plot
🚷 view threshold
113.00
(-1.33%)
117.94
(95.81%)
serialize_authorize📈 view plot
🚷 view threshold
12.12
(-1.11%)
12.51
(96.91%)
📈 view plot
🚷 view threshold
5.27
(-0.58%)
5.43
(97.05%)
📈 view plot
🚷 view threshold
7.33
(-0.70%)
7.60
(96.36%)
📈 view plot
🚷 view threshold
14.00
(+35.55%)
19.02
(73.62%)
📈 view plot
🚷 view threshold
135.00
(-2.14%)
143.36
(94.17%)
serialize_deserialize_authorize📈 view plot
🚷 view threshold
24.64
(-0.31%)
25.19
(97.82%)
📈 view plot
🚷 view threshold
9.84
(-0.18%)
10.01
(98.28%)
📈 view plot
🚷 view threshold
13.88
(-0.22%)
14.17
(97.89%)
📈 view plot
🚷 view threshold
38.00
(+5.60%)
45.99
(82.62%)
📈 view plot
🚷 view threshold
302.00
(-0.54%)
313.67
(96.28%)
serialize_deserialize_handle_authorize📈 view plot
🚷 view threshold
30.11
(-0.70%)
30.73
(97.97%)
📈 view plot
🚷 view threshold
12.02
(-0.28%)
12.19
(98.60%)
📈 view plot
🚷 view threshold
17.00
(-0.32%)
17.30
(98.30%)
📈 view plot
🚷 view threshold
59.00
(+5.59%)
67.50
(87.41%)
📈 view plot
🚷 view threshold
366.00
(-1.34%)
379.56
(96.43%)
serialize_deserialize_handle_submit📈 view plot
🚷 view threshold
126.24
(-0.16%)
126.79
(99.57%)
📈 view plot
🚷 view threshold
73.20
(-0.06%)
73.53
(99.55%)
📈 view plot
🚷 view threshold
104.91
(-0.08%)
105.51
(99.43%)
📈 view plot
🚷 view threshold
116.00
(+8.51%)
126.06
(92.02%)
📈 view plot
🚷 view threshold
593.00
(-0.79%)
610.69
(97.10%)
serialize_deserialize_handle_subscribe📈 view plot
🚷 view threshold
27.70
(-0.73%)
28.39
(97.59%)
📈 view plot
🚷 view threshold
9.58
(-0.47%)
9.76
(98.21%)
📈 view plot
🚷 view threshold
13.54
(-0.55%)
13.84
(97.83%)
📈 view plot
🚷 view threshold
68.00
(+5.21%)
78.10
(87.07%)
📈 view plot
🚷 view threshold
395.00
(-1.05%)
409.82
(96.38%)
serialize_deserialize_submit📈 view plot
🚷 view threshold
115.14
(-0.09%)
115.71
(99.51%)
📈 view plot
🚷 view threshold
68.06
(+0.01%)
68.42
(99.47%)
📈 view plot
🚷 view threshold
97.65
(+0.00%)
98.29
(99.35%)
📈 view plot
🚷 view threshold
69.00
(+4.93%)
87.84
(78.56%)
📈 view plot
🚷 view threshold
490.00
(-0.70%)
505.36
(96.96%)
serialize_deserialize_subscribe📈 view plot
🚷 view threshold
23.18
(-0.61%)
23.82
(97.32%)
📈 view plot
🚷 view threshold
8.14
(-0.50%)
8.32
(97.93%)
📈 view plot
🚷 view threshold
11.45
(-0.60%)
11.75
(97.48%)
📈 view plot
🚷 view threshold
43.00
(+9.90%)
51.32
(83.79%)
📈 view plot
🚷 view threshold
329.00
(-0.80%)
342.46
(96.07%)
serialize_submit📈 view plot
🚷 view threshold
99.57
(-0.21%)
100.09
(99.48%)
📈 view plot
🚷 view threshold
61.41
(-0.07%)
61.73
(99.47%)
📈 view plot
🚷 view threshold
88.08
(-0.08%)
88.65
(99.36%)
📈 view plot
🚷 view threshold
51.00
(+5.56%)
67.16
(75.93%)
📈 view plot
🚷 view threshold
321.00
(-1.35%)
337.65
(95.07%)
serialize_subscribe📈 view plot
🚷 view threshold
11.32
(-0.68%)
11.60
(97.62%)
📈 view plot
🚷 view threshold
4.12
(-1.01%)
4.28
(96.16%)
📈 view plot
🚷 view threshold
5.71
(-1.25%)
6.00
(95.16%)
📈 view plot
🚷 view threshold
17.00
(+20.96%)
24.45
(69.53%)
📈 view plot
🚷 view threshold
158.00
(-0.35%)
164.64
(95.97%)
🐰 View full continuous benchmarking report in Bencher

Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 3.79%. Comparing base (69a5398) to head (80b67d4).
Report is 2 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (69a5398) and HEAD (80b67d4). Click for more details.

HEAD has 23 uploads less than BASE
Flag BASE (69a5398) HEAD (80b67d4)
bip32_derivation-coverage 1 0
buffer_sv2-coverage 1 0
key-utils-coverage 1 0
utils 1 0
error_handling-coverage 2 0
binary_codec_sv2-coverage 1 0
noise_sv2-coverage 1 0
common_messages_sv2-coverage 1 0
const_sv2-coverage 1 0
job_declaration_sv2-coverage 1 0
sv2_ffi-coverage 1 0
roles_logic_sv2-coverage 1 0
binary_serde_sv2-coverage 1 0
codec_sv2-coverage 1 0
framing_sv2-coverage 1 0
protocols 1 0
binary_sv2-coverage 1 0
mining-coverage 1 0
pool_sv2-coverage 2 1
template_distribution_sv2-coverage 1 0
translator_sv2-coverage 1 0
v1-coverage 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #1319       +/-   ##
==========================================
- Coverage   19.11%   3.79%   -15.33%     
==========================================
  Files         166      44      -122     
  Lines       11047    2582     -8465     
==========================================
- Hits         2112      98     -2014     
+ Misses       8935    2484     -6451     
Flag Coverage Δ
binary_codec_sv2-coverage ?
binary_serde_sv2-coverage ?
binary_sv2-coverage ?
bip32_derivation-coverage ?
buffer_sv2-coverage ?
codec_sv2-coverage ?
common_messages_sv2-coverage ?
const_sv2-coverage ?
error_handling-coverage ?
framing_sv2-coverage ?
jd_client-coverage 0.00% <ø> (ø)
jd_server-coverage 7.79% <ø> (ø)
job_declaration_sv2-coverage ?
key-utils-coverage ?
mining-coverage ?
mining_device-coverage 0.00% <ø> (ø)
mining_proxy_sv2-coverage 0.70% <ø> (ø)
noise_sv2-coverage ?
pool_sv2-coverage 2.05% <ø> (ø)
protocols ?
roles 3.79% <ø> (-2.76%) ⬇️
roles_logic_sv2-coverage ?
sv2_ffi-coverage ?
template_distribution_sv2-coverage ?
translator_sv2-coverage ?
utils ?
v1-coverage ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jbesraa jbesraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this PR easier to review by undoing the formatting/indentation changes. If you are moving a function outside the TranslatorSV2 struct, do it in a separate commit and then commit the changes to make the fix

@Shourya742 Shourya742 force-pushed the 2024-12-23-fix-sigterm-translator-sv2 branch from 3ef1198 to 2a0d255 Compare January 3, 2025 05:04
Copy link
Contributor

github-actions bot commented Jan 3, 2025

🐰 Bencher Report

Branch2024-12-23-fix-sigterm-translator-sv2
Testbedsv1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
client-submit-serialize📈 view plot
🚷 view threshold
6,403.60
(-2.11%)
6,967.64
(91.90%)
client-submit-serialize-deserialize📈 view plot
🚷 view threshold
7,372.90
(-0.32%)
7,783.51
(94.72%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle📈 view plot
🚷 view threshold
7,925.70
(-1.20%)
8,448.04
(93.82%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle📈 view plot
🚷 view threshold
879.30
(+1.37%)
935.02
(94.04%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize📈 view plot
🚷 view threshold
682.37
(+0.75%)
721.29
(94.60%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize📈 view plot
🚷 view threshold
250.02
(-0.36%)
280.16
(89.24%)
client-sv1-get-authorize/client-sv1-get-authorize📈 view plot
🚷 view threshold
156.77
(-0.67%)
168.12
(93.25%)
client-sv1-get-submit📈 view plot
🚷 view threshold
6,236.20
(-1.36%)
6,676.21
(93.41%)
client-sv1-get-subscribe/client-sv1-get-subscribe📈 view plot
🚷 view threshold
280.56
(-2.87%)
385.28
(72.82%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle📈 view plot
🚷 view threshold
740.52
(+1.89%)
768.73
(96.33%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize📈 view plot
🚷 view threshold
599.16
(+0.95%)
644.96
(92.90%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize📈 view plot
🚷 view threshold
204.62
(-0.73%)
221.54
(92.36%)
🐰 View full continuous benchmarking report in Bencher

@Shourya742 Shourya742 force-pushed the 2024-12-23-fix-sigterm-translator-sv2 branch from 2a0d255 to 04455f0 Compare January 5, 2025 03:39
@plebhash
Copy link
Collaborator

plebhash commented Jan 6, 2025

tACK

@plebhash plebhash added the roles Pertains to all roles label Jan 6, 2025
@plebhash plebhash added this to the 1.3.0 milestone Jan 6, 2025
Copy link
Contributor

@jbesraa jbesraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just one small nit.

IMO before we merge this or #1321, a test to cover the feature/bug fix should be implemented.

roles/translator/src/lib/mod.rs Show resolved Hide resolved
@Shourya742 Shourya742 force-pushed the 2024-12-23-fix-sigterm-translator-sv2 branch from 04455f0 to 282aa52 Compare January 9, 2025 13:08
@plebhash
Copy link
Collaborator

plebhash commented Jan 9, 2025

IMO before we merge this or #1321, a test to cover the feature/bug fix should be implemented.

that is a good point, overall I'm always supportive of the idea of always reproducing bugs and enforcing sane behavior on edge cases via CI

but is that something that could be achieved via integration tests?

I can imagine the following flow:

  • launch TP + pool
  • connect tProxy to pool
  • kill pool (which puts tProxy in the buggy state)
  • try to kill tProxy (buggy should not be killed, fixed should be killed)

however I'm not sure how to achieve this inside the test environment via Rust code... is there a way to programatically emulate a sigterm that would only be directed to tProxy and not the entire test execution?

(btw I'm not arguing it's not possible, just haven't done the research no I don't have full confidence on my reasoning)

@Shourya742
Copy link
Contributor Author

IMO before we merge this or #1321, a test to cover the feature/bug fix should be implemented.

that is a good point, overall I'm always supportive of the idea of always reproducing bugs and enforcing sane behavior on edge cases via CI

but is that something that could be achieved via integration tests?

I can imagine the following flow:

  • launch TP + pool
  • connect tProxy to pool
  • kill pool (which puts tProxy in the buggy state)
  • try to kill tProxy (buggy should not be killed, fixed should be killed)

however I'm not sure how to achieve this inside the test environment via Rust code... is there a way to programatically emulate a sigterm that would only be directed to tProxy and not the entire test execution?

(btw I'm not arguing it's not possible, just haven't done the research no I don't have full confidence on my reasoning)

This can be done. I have tried sending terminal signals to the process, but I’m unsure about including that in this PR or adding any testing for it. The primary scope of this PR was to resolve the ctrl+c issue we were facing, and since most of us have already tested and confirmed that it works, the scope for this PR ends here.
Additionally, I’ve added a shutdown field to the struct to facilitate shutting down any role’s process during integration tests. However, further modifications are needed. Currently, we are simply performing a process exit, but for integration tests, we need to ensure that the process is not terminated and only roles exit while also making sure that no tasks associated with the terminated process persist in the Tokio executor. These changes could be addressed in a follow-up PR.
The reasons for not including these in the current PR are:

  1. The primary purpose of this PR was to resolve the ghost task issue, which it successfully does.
  2. Process termination for integration testing can be handled in a separate PR.
    cc: @jbesraa @plebhash

@jbesraa
Copy link
Contributor

jbesraa commented Jan 9, 2025

This PR is resolving(partially, the translator part) #1266.
And #1266 was opened because we were not able to do #1207. IMO in order to make sure this is the solution we want(it might be a solution to a different problem), #1207 need to be resolved.

Just a reminder, for #1207 I was able to write the test fully and run it successfully, but the translator and jdc keep process in the background that are not shutdown when the test finish so it goes forever.

@jbesraa
Copy link
Contributor

jbesraa commented Jan 9, 2025

@Shourya742 #1343 this branch have your code and the test(for #1207) I wrote back then(I did some changes to align it with current API design). Feel free to pick it up, otherwise Ill look into it tomorrow.

@Shourya742
Copy link
Contributor Author

@Shourya742 #1343 this branch have your code and the test(for #1207) I wrote back then(I did some changes to align it with current API design). Feel free to pick it up, otherwise Ill look into it tomorrow.

Let me complete it then, I know what might be the pain point. If my analysis is correct. Will let you know. Thanks for this..

@Shourya742 Shourya742 force-pushed the 2024-12-23-fix-sigterm-translator-sv2 branch from 66dada7 to ab1d4b8 Compare January 13, 2025 13:49
@jbesraa jbesraa mentioned this pull request Jan 14, 2025
@plebhash plebhash added the ready-to-be-merged triggers auto rebase bot label Jan 14, 2025
@pavlenex pavlenex force-pushed the 2024-12-23-fix-sigterm-translator-sv2 branch from ab1d4b8 to 8c7b53b Compare January 14, 2025 17:46
@pavlenex pavlenex force-pushed the 2024-12-23-fix-sigterm-translator-sv2 branch from 8c7b53b to 80b67d4 Compare January 15, 2025 15:28
@plebhash plebhash merged commit feee603 into stratum-mining:main Jan 15, 2025
35 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-be-merged triggers auto rebase bot roles Pertains to all roles
Projects
Status: Done ✅
Development

Successfully merging this pull request may close these issues.

Investigate ghost processes in tproxy and JDC
3 participants