hypershell 2.8.5__tar.gz → 2.8.6__tar.gz

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.
Files changed (189) hide show
  1. {hypershell-2.8.5 → hypershell-2.8.6}/PKG-INFO +1 -1
  2. {hypershell-2.8.5 → hypershell-2.8.6}/pyproject.toml +1 -1
  3. {hypershell-2.8.5 → hypershell-2.8.6}/share/man/man1/hs.1 +1 -1
  4. {hypershell-2.8.5 → hypershell-2.8.6}/share/man/man1/hsx.1 +1 -1
  5. {hypershell-2.8.5 → hypershell-2.8.6}/share/man/man1/hyper-shell.1 +1 -1
  6. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/queue.py +7 -4
  7. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/server.py +24 -4
  8. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_cluster.py +21 -0
  9. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_groups.py +34 -11
  10. hypershell-2.8.6/tests/test_heartmonitor.py +120 -0
  11. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_queue_nodelay.py +13 -0
  12. {hypershell-2.8.5 → hypershell-2.8.6}/uv.lock +1 -1
  13. {hypershell-2.8.5 → hypershell-2.8.6}/.gitignore +0 -0
  14. {hypershell-2.8.5 → hypershell-2.8.6}/CODE_OF_CONDUCT.md +0 -0
  15. {hypershell-2.8.5 → hypershell-2.8.6}/LICENSE +0 -0
  16. {hypershell-2.8.5 → hypershell-2.8.6}/README.rst +0 -0
  17. {hypershell-2.8.5 → hypershell-2.8.6}/docs/Makefile +0 -0
  18. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/citation.rst +0 -0
  19. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/client_desc.rst +0 -0
  20. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/client_help.rst +0 -0
  21. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/client_usage.rst +0 -0
  22. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/cluster_desc.rst +0 -0
  23. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/cluster_help.rst +0 -0
  24. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/cluster_usage.rst +0 -0
  25. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_desc.rst +0 -0
  26. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_edit_desc.rst +0 -0
  27. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_edit_help.rst +0 -0
  28. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_edit_usage.rst +0 -0
  29. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_get_desc.rst +0 -0
  30. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_get_help.rst +0 -0
  31. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_get_usage.rst +0 -0
  32. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_help.rst +0 -0
  33. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_intro.rst +0 -0
  34. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_intro_alt.rst +0 -0
  35. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_param_ref.rst +0 -0
  36. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_pythonpath.rst +0 -0
  37. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_set_desc.rst +0 -0
  38. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_set_help.rst +0 -0
  39. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_set_usage.rst +0 -0
  40. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_site_vars.rst +0 -0
  41. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_task_env.rst +0 -0
  42. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_task_env_alt.rst +0 -0
  43. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_usage.rst +0 -0
  44. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_which_desc.rst +0 -0
  45. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_which_help.rst +0 -0
  46. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/config_which_usage.rst +0 -0
  47. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/database.rst +0 -0
  48. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/database_alt.rst +0 -0
  49. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/desc.rst +0 -0
  50. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/exit_status.rst +0 -0
  51. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/initdb_desc.rst +0 -0
  52. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/initdb_help.rst +0 -0
  53. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/initdb_usage.rst +0 -0
  54. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/license.rst +0 -0
  55. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/security_alt.rst +0 -0
  56. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/server_desc.rst +0 -0
  57. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/server_help.rst +0 -0
  58. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/server_usage.rst +0 -0
  59. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/signals.rst +0 -0
  60. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/submit_desc.rst +0 -0
  61. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/submit_help.rst +0 -0
  62. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/submit_usage.rst +0 -0
  63. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_groups_alt.rst +0 -0
  64. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_info_desc.rst +0 -0
  65. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_info_help.rst +0 -0
  66. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_info_usage.rst +0 -0
  67. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_run_desc.rst +0 -0
  68. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_run_help.rst +0 -0
  69. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_run_usage.rst +0 -0
  70. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_search_desc.rst +0 -0
  71. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_search_help.rst +0 -0
  72. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_search_usage.rst +0 -0
  73. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_submit_desc.rst +0 -0
  74. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_submit_help.rst +0 -0
  75. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_submit_usage.rst +0 -0
  76. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_update_desc.rst +0 -0
  77. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_update_help.rst +0 -0
  78. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_update_usage.rst +0 -0
  79. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_wait_desc.rst +0 -0
  80. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_wait_help.rst +0 -0
  81. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/task_wait_usage.rst +0 -0
  82. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/templates.rst +0 -0
  83. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/templates_alt.rst +0 -0
  84. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_include/tls_cli_options.rst +0 -0
  85. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_static/custom.css +0 -0
  86. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_static/logo-dark-mode.png +0 -0
  87. {hypershell-2.8.5 → hypershell-2.8.6}/docs/_static/logo-light-mode.png +0 -0
  88. {hypershell-2.8.5 → hypershell-2.8.6}/docs/api/client.rst +0 -0
  89. {hypershell-2.8.5 → hypershell-2.8.6}/docs/api/cluster.rst +0 -0
  90. {hypershell-2.8.5 → hypershell-2.8.6}/docs/api/data.rst +0 -0
  91. {hypershell-2.8.5 → hypershell-2.8.6}/docs/api/index.rst +0 -0
  92. {hypershell-2.8.5 → hypershell-2.8.6}/docs/api/server.rst +0 -0
  93. {hypershell-2.8.5 → hypershell-2.8.6}/docs/api/submit.rst +0 -0
  94. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/20230329_2_2_0_release.rst +0 -0
  95. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/20230413_2_3_0_release.rst +0 -0
  96. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/20230602_2_4_0_release.rst +0 -0
  97. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/20240518_2_5_0_release.rst +0 -0
  98. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/20240706_2_5_2_release.rst +0 -0
  99. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/20241115_2_6_0_release.rst +0 -0
  100. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/20241115_announce_logo.rst +0 -0
  101. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/20241231_2_6_1_release.rst +0 -0
  102. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/20250215_2_6_5_release.rst +0 -0
  103. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/20250405_2_6_6_release.rst +0 -0
  104. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/20250504_2_7_0_release.rst +0 -0
  105. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/20260705_2_8_0_release.rst +0 -0
  106. {hypershell-2.8.5 → hypershell-2.8.6}/docs/blog/index.rst +0 -0
  107. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/client.rst +0 -0
  108. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/cluster.rst +0 -0
  109. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/config.rst +0 -0
  110. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/config_edit.rst +0 -0
  111. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/config_get.rst +0 -0
  112. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/config_set.rst +0 -0
  113. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/config_which.rst +0 -0
  114. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/index.rst +0 -0
  115. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/initdb.rst +0 -0
  116. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/server.rst +0 -0
  117. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/submit.rst +0 -0
  118. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/task_info.rst +0 -0
  119. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/task_run.rst +0 -0
  120. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/task_search.rst +0 -0
  121. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/task_submit.rst +0 -0
  122. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/task_update.rst +0 -0
  123. {hypershell-2.8.5 → hypershell-2.8.6}/docs/cli/task_wait.rst +0 -0
  124. {hypershell-2.8.5 → hypershell-2.8.6}/docs/conf.py +0 -0
  125. {hypershell-2.8.5 → hypershell-2.8.6}/docs/config.rst +0 -0
  126. {hypershell-2.8.5 → hypershell-2.8.6}/docs/database.rst +0 -0
  127. {hypershell-2.8.5 → hypershell-2.8.6}/docs/getting_started.rst +0 -0
  128. {hypershell-2.8.5 → hypershell-2.8.6}/docs/index.rst +0 -0
  129. {hypershell-2.8.5 → hypershell-2.8.6}/docs/install.rst +0 -0
  130. {hypershell-2.8.5 → hypershell-2.8.6}/docs/logging.rst +0 -0
  131. {hypershell-2.8.5 → hypershell-2.8.6}/docs/manual.rst +0 -0
  132. {hypershell-2.8.5 → hypershell-2.8.6}/docs/roadmap.rst +0 -0
  133. {hypershell-2.8.5 → hypershell-2.8.6}/docs/security.rst +0 -0
  134. {hypershell-2.8.5 → hypershell-2.8.6}/docs/templates.rst +0 -0
  135. {hypershell-2.8.5 → hypershell-2.8.6}/docs/tutorial/advanced.rst +0 -0
  136. {hypershell-2.8.5 → hypershell-2.8.6}/docs/tutorial/basic.rst +0 -0
  137. {hypershell-2.8.5 → hypershell-2.8.6}/docs/tutorial/distributed.rst +0 -0
  138. {hypershell-2.8.5 → hypershell-2.8.6}/docs/tutorial/hybrid.rst +0 -0
  139. {hypershell-2.8.5 → hypershell-2.8.6}/share/bash_completion.d/hs +0 -0
  140. {hypershell-2.8.5 → hypershell-2.8.6}/share/bash_completion.d/hsx +0 -0
  141. {hypershell-2.8.5 → hypershell-2.8.6}/share/zsh/site-functions/_hs +0 -0
  142. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/__init__.py +0 -0
  143. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/client.py +0 -0
  144. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/cluster/__init__.py +0 -0
  145. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/cluster/launch.py +0 -0
  146. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/cluster/local.py +0 -0
  147. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/cluster/remote.py +0 -0
  148. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/cluster/ssh.py +0 -0
  149. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/config.py +0 -0
  150. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/__init__.py +0 -0
  151. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/config.py +0 -0
  152. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/exceptions.py +0 -0
  153. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/fsm.py +0 -0
  154. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/heartbeat.py +0 -0
  155. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/logging.py +0 -0
  156. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/platform.py +0 -0
  157. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/pretty_print.py +0 -0
  158. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/remote.py +0 -0
  159. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/resource.py +0 -0
  160. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/signal.py +0 -0
  161. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/sys.py +0 -0
  162. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/tag.py +0 -0
  163. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/template.py +0 -0
  164. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/thread.py +0 -0
  165. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/tls.py +0 -0
  166. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/types.py +0 -0
  167. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/core/uuid.py +0 -0
  168. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/data/__init__.py +0 -0
  169. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/data/core.py +0 -0
  170. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/data/model.py +0 -0
  171. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/submit.py +0 -0
  172. {hypershell-2.8.5 → hypershell-2.8.6}/src/hypershell/task.py +0 -0
  173. {hypershell-2.8.5 → hypershell-2.8.6}/tests/__init__.py +0 -0
  174. {hypershell-2.8.5 → hypershell-2.8.6}/tests/conftest.py +0 -0
  175. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_autoscale.py +0 -0
  176. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_cancel.py +0 -0
  177. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_cluster_launch.py +0 -0
  178. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_data/__init__.py +0 -0
  179. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_data/test_core.py +0 -0
  180. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_data/test_model.py +0 -0
  181. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_group_order.py +0 -0
  182. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_initdb.py +0 -0
  183. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_logging.py +0 -0
  184. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_main.py +0 -0
  185. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_queue_address_family.py +0 -0
  186. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_queue_tls.py +0 -0
  187. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_retry_gate.py +0 -0
  188. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_server.py +0 -0
  189. {hypershell-2.8.5 → hypershell-2.8.6}/tests/test_submit.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: hypershell
3
- Version: 2.8.5
3
+ Version: 2.8.6
4
4
  Summary: A cross-platform, high-throughput computing utility for processing shell commands over a distributed, asynchronous queue.
5
5
  Project-URL: Homepage, https://hypershell.org
6
6
  Project-URL: Documentation, https://hypershell.readthedocs.io
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hypershell"
3
- version = "2.8.5"
3
+ version = "2.8.6"
4
4
  description = "A cross-platform, high-throughput computing utility for processing shell commands over a distributed, asynchronous queue."
5
5
  readme = "README.rst"
6
6
  license = "Apache-2.0"
@@ -28,7 +28,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
28
  .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29
29
  .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
30
30
  ..
31
- .TH "HS" "1" "Nov 05, 2026" "2.8.5" "hypershell"
31
+ .TH "HS" "1" "Nov 08, 2026" "2.8.6" "hypershell"
32
32
  .SH NAME
33
33
  hs \- Process shell commands over a distributed, asynchronous queue
34
34
  .SH SYNOPSIS
@@ -28,7 +28,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
28
  .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29
29
  .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
30
30
  ..
31
- .TH "HS" "1" "Nov 05, 2026" "2.8.5" "hypershell"
31
+ .TH "HS" "1" "Nov 08, 2026" "2.8.6" "hypershell"
32
32
  .SH NAME
33
33
  hs \- Process shell commands over a distributed, asynchronous queue
34
34
  .SH SYNOPSIS
@@ -28,7 +28,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
28
  .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29
29
  .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
30
30
  ..
31
- .TH "HYPER-SHELL" "1" "Nov 05, 2026" "2.8.5" "hypershell"
31
+ .TH "HYPER-SHELL" "1" "Nov 08, 2026" "2.8.6" "hypershell"
32
32
  .SH NAME
33
33
  hyper-shell \- Process shell commands over a distributed, asynchronous queue
34
34
  .SH SYNOPSIS
@@ -460,10 +460,13 @@ class QueueServer(QueueInterface):
460
460
  self.completed = JoinableQueue(maxsize=self.config.size)
461
461
  self.heartbeat = JoinableQueue(maxsize=0)
462
462
  self.confirmed = JoinableQueue(maxsize=0)
463
- self.register('_get_scheduled', callable=self._get_scheduled)
464
- self.register('_get_completed', callable=self._get_completed)
465
- self.register('_get_heartbeat', callable=self._get_heartbeat)
466
- self.register('_get_confirmed', callable=self._get_confirmed)
463
+ # Without create_method=False, register() replaces these methods on the class with ones that
464
+ # ask a running server for a proxy, and the next server started in this process would serve
465
+ # those in place of its queues (under fork, which copies the changed class to the server).
466
+ self.register('_get_scheduled', callable=self._get_scheduled, create_method=False)
467
+ self.register('_get_completed', callable=self._get_completed, create_method=False)
468
+ self.register('_get_heartbeat', callable=self._get_heartbeat, create_method=False)
469
+ self.register('_get_confirmed', callable=self._get_confirmed, create_method=False)
467
470
  super().start()
468
471
  self.ready = True
469
472
 
@@ -566,6 +566,7 @@ class HeartMonitor(StateMachine):
566
566
  startup_phase: bool = True # should not halt until at least one client
567
567
  scheduler_done: bool = False # set by parent thread when scheduling is over
568
568
  should_signal: bool = False # set by parent thread to signal clients
569
+ signaled: bool = False # clients have been told to disconnect; late arrivals are told too
569
570
  latest_heartbeat: Heartbeat = None
570
571
 
571
572
  state = HeartbeatState.START
@@ -635,6 +636,9 @@ class HeartMonitor(StateMachine):
635
636
  Client.update(old_client.id, disconnected_at=None, evicted=False)
636
637
  except Client.NotFound:
637
638
  Client.add(new_client)
639
+ if self.signaled:
640
+ # Registered after the others were told to disconnect: it needs its own disconnect
641
+ self.request_disconnect(hb)
638
642
  self.beats[hb.uuid] = hb
639
643
  return HeartbeatState.SWITCH
640
644
  else:
@@ -643,6 +647,10 @@ class HeartMonitor(StateMachine):
643
647
  self.beats.pop(hb.uuid)
644
648
  if not self.in_memory:
645
649
  Client.update(hb.uuid, disconnected_at=datetime.now().astimezone())
650
+ elif self.signaled:
651
+ # Finished without ever registering, so it may have taken a disconnect that was
652
+ # posted for a registered client: post one in its place
653
+ self.request_disconnect(hb)
646
654
  return HeartbeatState.SWITCH
647
655
 
648
656
  def switch_mode(self: HeartMonitor) -> HeartbeatState:
@@ -677,14 +685,26 @@ class HeartMonitor(StateMachine):
677
685
  return HeartbeatState.SWITCH
678
686
 
679
687
  def signal_clients(self: HeartMonitor) -> HeartbeatState:
680
- """Send shutdown signal to all connected clients."""
688
+ """
689
+ Send shutdown signal to all connected clients.
690
+
691
+ Each disconnect is one sentinel on the shared task queue, taken by whichever client reads
692
+ next, so every client must have one posted for it. Clients are counted by heartbeat, and a
693
+ client can take tasks before its first heartbeat arrives. One that registers after this
694
+ signal, or finishes without having registered, gets a disconnect of its own then.
695
+ """
681
696
  log.debug(f'Signaling clients ({len(self.beats)} connected)')
682
697
  for hb in self.beats.values():
683
- self.queue.scheduled.put(make_sentinel())
684
- log.debug(f'Disconnect requested ({hb.host}: {hb.uuid})')
698
+ self.request_disconnect(hb)
699
+ self.signaled = True
685
700
  self.should_signal = False
686
701
  return HeartbeatState.SWITCH
687
702
 
703
+ def request_disconnect(self: HeartMonitor, hb: Heartbeat) -> None:
704
+ """Post one disconnect (sentinel) on the task queue on behalf of the client that sent `hb`."""
705
+ self.queue.scheduled.put(make_sentinel())
706
+ log.debug(f'Disconnect requested ({hb.host}: {hb.uuid})')
707
+
688
708
  @staticmethod
689
709
  def finalize() -> HeartbeatState:
690
710
  """Stop heart monitor."""
@@ -871,7 +891,7 @@ class ServerThread(Thread):
871
891
  self.confirm = ConfirmThread(queue=self.queue, in_memory=self.in_memory)
872
892
  self.receiver = ReceiverThread(queue=self.queue, in_memory=self.in_memory, redirect_failures=redirect_failures)
873
893
  self.heartmonitor = HeartMonitorThread(queue=self.queue, evict_after=evict_after,
874
- in_memory=in_memory, no_confirm=no_confirm)
894
+ in_memory=self.in_memory, no_confirm=no_confirm)
875
895
  log.info(f'Server listening on {address[0]}:{address[1]}')
876
896
  super().__init__(name='hypershell-server')
877
897
 
@@ -9,7 +9,9 @@ from __future__ import annotations
9
9
  from typing import Final, Dict
10
10
 
11
11
  # Standard libs
12
+ import os
12
13
  from pathlib import Path
14
+ from subprocess import run
13
15
 
14
16
  # External libs
15
17
  from pytest import mark
@@ -149,6 +151,25 @@ def test_cluster_basic(temp_site: Path) -> None:
149
151
  assert_output(r'\[hypershell.client\] Completed task', stderr, 4)
150
152
 
151
153
 
154
+ @mark.integration
155
+ def test_cluster_memory_database(temp_site: Path) -> None:
156
+ """Run small collection of tasks with the database configured as ``:memory:``.
157
+
158
+ That configuration disables the database without ``--no-db``, so every server
159
+ thread must run in memory: none may query a database that was never initialized.
160
+ """
161
+ site = Path(str(temp_site))
162
+ taskfile = create_taskfile_echo(site, count=4)
163
+ env = {**os.environ, 'HYPERSHELL_DATABASE_FILE': ':memory:'}
164
+ proc = run(['hs', 'cluster', str(taskfile), '-N', '2'], cwd=site, env=env,
165
+ capture_output=True, text=True, timeout=60)
166
+ assert proc.returncode == exit_status.success, proc.stderr
167
+ assert sorted(proc.stdout.split()) == list(map(str, range(4)))
168
+ assert_output(r'\[hypershell.server\] Completed task', proc.stderr, 4)
169
+ assert not list(site.rglob('*.db'))
170
+ assert not (site / ':memory:').exists()
171
+
172
+
152
173
  @mark.integration
153
174
  def test_cluster_database(temp_site: Path) -> None:
154
175
  """Run small collection of tasks from file to database."""
@@ -6,10 +6,12 @@
6
6
 
7
7
  # Type annotations
8
8
  from __future__ import annotations
9
- from typing import Final
9
+ from typing import Dict, Final, List, Tuple
10
10
 
11
11
  # Standard libs
12
+ import json
12
13
  from pathlib import Path
14
+ from datetime import datetime
13
15
 
14
16
  # External libs
15
17
  from pytest import mark
@@ -260,6 +262,18 @@ def test_group_mixed_inline_and_cli_specification(temp_site: Path) -> None:
260
262
  assert_output(r'Completed task group 2 - starting task group 5', stderr, 1)
261
263
 
262
264
 
265
+ def task_intervals() -> Dict[int, List[Tuple[datetime, datetime]]]:
266
+ """Run interval (start, completion) of every task, by group, from `hs list --json`."""
267
+ rc, stdout, _ = main(['hs', 'list', 'group', 'start_time', 'completion_time', '--json'])
268
+ assert rc == exit_status.success
269
+ runs = {}
270
+ for record in json.loads(stdout):
271
+ assert record['start_time'] is not None and record['completion_time'] is not None
272
+ interval = datetime.fromisoformat(record['start_time']), datetime.fromisoformat(record['completion_time'])
273
+ runs.setdefault(record['group'], []).append(interval)
274
+ return runs
275
+
276
+
263
277
  @mark.integration
264
278
  def test_group_parallel_execution_within_group(temp_site: Path) -> None:
265
279
  """Tasks within the same group execute in parallel."""
@@ -276,19 +290,28 @@ def test_group_parallel_execution_within_group(temp_site: Path) -> None:
276
290
  ]
277
291
 
278
292
  taskfile = create_taskfile(temp_site, tasks)
279
-
280
- import time
281
- start = time.time()
282
293
  rc, stdout, stderr = main(['hs', 'cluster', str(taskfile), '-N8'])
283
- elapsed = time.time() - start
284
294
  assert rc == exit_status.success
285
295
  assert sorted(stdout.strip().splitlines()) == list(map(str, range(len(tasks))))
286
-
287
- # With 8 threads we should be able to get through everything in one shot (~1 second ignoring overhead)
288
- # But because of the groups we can only execute one group at a time regardless of threads
289
- # So that's 4 seconds plus 1-2 second backoff between groups
290
- assert elapsed > 4 + 3*2, f'Expected > 10s for parallel execution, took {elapsed:.1f}s'
291
-
296
+
297
+ # Run intervals are read from the database, which is authoritative. The wall clock of the
298
+ # whole run measures startup and the backoff between groups, not parallelism, so it is not
299
+ # asserted on.
300
+ runs = task_intervals()
301
+ assert sorted(runs) == [1, 2, 3, 4]
302
+ assert all(len(intervals) == 2 for intervals in runs.values())
303
+
304
+ # Within each group the two tasks run at the same time: their run intervals overlap.
305
+ for group, ((start_a, end_a), (start_b, end_b)) in runs.items():
306
+ assert max(start_a, start_b) < min(end_a, end_b), f'Group {group} ran serially: {runs[group]}'
307
+
308
+ # Groups run in order: every task of one group completes before any task of the next starts.
309
+ groups = sorted(runs)
310
+ for lower, higher in zip(groups, groups[1:]):
311
+ last_end = max(end for _, end in runs[lower])
312
+ first_start = min(start for start, _ in runs[higher])
313
+ assert last_end < first_start, f'Group {higher} started before group {lower} completed'
314
+
292
315
  # All tasks should complete
293
316
  assert_output(r'Completed task group 1 - starting task group 2', stderr, 1)
294
317
  assert_output(r'Completed task group 2 - starting task group 3', stderr, 1)
@@ -0,0 +1,120 @@
1
+ # SPDX-FileCopyrightText: 2026 Geoffrey Lentner
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """
5
+ The server's heart monitor tells every client to disconnect, including late ones.
6
+
7
+ A disconnect is one sentinel on the shared task queue, taken by whichever client reads next.
8
+ Clients are counted by heartbeat, and a client can take (and finish) tasks before its first
9
+ heartbeat reaches the server, so the count at the moment of the signal can be short. Each test
10
+ drives the monitor's states by hand over in-process queues, in a given order of arrival.
11
+ """
12
+
13
+
14
+ # Type annotations
15
+ from __future__ import annotations
16
+ from typing import List
17
+
18
+ # Standard libs
19
+ from queue import Queue
20
+ from dataclasses import dataclass, field
21
+
22
+ # Internal libs
23
+ from hypershell.core.heartbeat import Heartbeat, ClientState
24
+ from hypershell.core.queue import make_sentinel
25
+ from hypershell.server import HeartMonitor, HeartbeatState
26
+
27
+
28
+ @dataclass
29
+ class FakeQueue:
30
+ """The two server queues the heart monitor uses."""
31
+
32
+ heartbeat: Queue = field(default_factory=Queue)
33
+ scheduled: Queue = field(default_factory=Queue)
34
+
35
+ def sentinels(self: FakeQueue) -> int:
36
+ """Count of disconnects posted so far (the queue holds nothing else here)."""
37
+ items = []
38
+ while not self.scheduled.empty():
39
+ items.append(self.scheduled.get_nowait())
40
+ for item in items:
41
+ self.scheduled.put(item)
42
+ assert all(item == make_sentinel() for item in items)
43
+ return len(items)
44
+
45
+
46
+ def new_monitor() -> HeartMonitor:
47
+ """A heart monitor over fake queues, without a database."""
48
+ return HeartMonitor(queue=FakeQueue(), in_memory=True) # noqa: duck-typed queue server
49
+
50
+
51
+ def beat(name: str, state: ClientState = ClientState.RUNNING) -> Heartbeat:
52
+ """A heartbeat from client `name`."""
53
+ return Heartbeat.new(uuid=name, host='host-' + name, state=state)
54
+
55
+
56
+ def deliver(monitor: HeartMonitor, *heartbeats: Heartbeat) -> None:
57
+ """The monitor takes each heartbeat, in order, as its next one."""
58
+ for hb in heartbeats:
59
+ monitor.queue.heartbeat.put(hb.pack())
60
+ assert monitor.get_next() is HeartbeatState.UPDATE
61
+ assert monitor.update_client() is HeartbeatState.SWITCH
62
+
63
+
64
+ def signal(monitor: HeartMonitor) -> None:
65
+ """Scheduling is over: the server tells the connected clients to disconnect."""
66
+ monitor.scheduler_done = True
67
+ monitor.should_signal = True
68
+ assert monitor.switch_mode() is HeartbeatState.SIGNAL
69
+ assert monitor.signal_clients() is HeartbeatState.SWITCH
70
+
71
+
72
+ def finished(monitor: HeartMonitor) -> bool:
73
+ """The monitor would stop now."""
74
+ return monitor.switch_mode() is HeartbeatState.FINAL
75
+
76
+
77
+ def test_signal_posts_one_disconnect_per_registered_client() -> None:
78
+ """Every client registered when the signal is sent gets a disconnect."""
79
+ monitor = new_monitor()
80
+ deliver(monitor, beat('a'), beat('b'))
81
+ signal(monitor)
82
+ assert monitor.queue.sentinels() == 2
83
+ deliver(monitor, beat('a', ClientState.FINISHED), beat('b', ClientState.FINISHED))
84
+ assert monitor.queue.sentinels() == 2
85
+ assert finished(monitor)
86
+
87
+
88
+ def test_client_registered_after_signal_gets_disconnect() -> None:
89
+ """A client whose first heartbeat arrives after the signal is told to disconnect too."""
90
+ monitor = new_monitor()
91
+ deliver(monitor, beat('a'))
92
+ signal(monitor)
93
+ assert monitor.queue.sentinels() == 1
94
+ deliver(monitor, beat('b'))
95
+ assert monitor.queue.sentinels() == 2, 'Late client was never told to disconnect'
96
+ deliver(monitor, beat('b'), beat('a', ClientState.FINISHED), beat('b', ClientState.FINISHED))
97
+ assert monitor.queue.sentinels() == 2
98
+ assert finished(monitor)
99
+
100
+
101
+ def test_client_finished_unregistered_after_signal_replaces_disconnect() -> None:
102
+ """A client that finishes before it ever registered may have taken another's disconnect: one is posted in its place."""
103
+ monitor = new_monitor()
104
+ deliver(monitor, beat('a'))
105
+ signal(monitor)
106
+ monitor.queue.scheduled.get_nowait() # Client b, not yet registered, takes the one disconnect
107
+ deliver(monitor, beat('b', ClientState.FINISHED))
108
+ assert monitor.queue.sentinels() == 1, 'Registered client was left without a disconnect'
109
+ assert not finished(monitor)
110
+ deliver(monitor, beat('a', ClientState.FINISHED))
111
+ assert finished(monitor)
112
+
113
+
114
+ def test_no_disconnect_before_signal() -> None:
115
+ """Clients that come and go before the signal get no disconnect, and the signal counts only those connected."""
116
+ monitor = new_monitor()
117
+ deliver(monitor, beat('a'), beat('b'), beat('a', ClientState.FINISHED), beat('c', ClientState.FINISHED))
118
+ assert monitor.queue.sentinels() == 0
119
+ signal(monitor)
120
+ assert monitor.queue.sentinels() == 1
@@ -104,6 +104,19 @@ def test_roundtrip(tls: Optional[TLSConfig]) -> None:
104
104
  roundtrip(tls)
105
105
 
106
106
 
107
+ @mark.unit
108
+ def test_second_server_in_one_process(tls: Optional[TLSConfig]) -> None:
109
+ """A queue server started after another in the same process serves its own queues.
110
+
111
+ Starting a server must leave the server class's queue getters in place; replaced by
112
+ proxy-making methods, they reach the next server's process (under fork) in place of its queues.
113
+ """
114
+ getters = {name: QueueServer.__dict__[f'_get_{name}'] for name in NAMES}
115
+ roundtrip(tls)
116
+ assert {name: QueueServer.__dict__[f'_get_{name}'] for name in NAMES} == getters
117
+ roundtrip(tls)
118
+
119
+
107
120
  @mark.unit
108
121
  def test_roundtrip_under_default_timeout(tls: Optional[TLSConfig], default_timeout: float) -> None:
109
122
  """A process default socket timeout leaves the queue connections working.
@@ -616,7 +616,7 @@ wheels = [
616
616
 
617
617
  [[package]]
618
618
  name = "hypershell"
619
- version = "2.8.5"
619
+ version = "2.8.6"
620
620
  source = { editable = "." }
621
621
  default-groups = ["dev", "docs"]
622
622
  dependencies = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes