Skip to content

Commit

Permalink
fixed bug where actor-system shutdown would not close scheduler thread.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdbergmann committed Jan 28, 2024
1 parent f6a7269 commit f97bdcf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
10 changes: 5 additions & 5 deletions sento.asd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(defsystem "sento"
:version "3.1.0"
:version "3.1.1"
:author "Manfred Bergmann"
:license "Apache-2"
:description "Actor framework featuring actors and agents for easy access to state and asynchronous operations."
Expand Down Expand Up @@ -178,10 +178,10 @@ OK - cons-queue as separate 'high-speed' system
Sento 3.1 todos:
- check COUNTER-MP-UNBOUNDED and BOUNDED tests for LW 8
- create documentation MGL-PAX
- tag version
- upload
OK - check COUNTER-MP-UNBOUNDED and BOUNDED tests for LW 8
OK - create documentation MGL-PAX
OK - tag version
OK - upload
|#

7 changes: 6 additions & 1 deletion src/actor-system.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,12 @@ Users should use `ac:find-actors`."

(defmethod shutdown ((self actor-system) &key (wait nil))
"See `ac:shutdown`"
(wt:shutdown-wheel-timer (timeout-timer self))
(with-slots (timeout-timer scheduler) self
(wt:shutdown-wheel-timer timeout-timer)
(setf timeout-timer nil)
(when scheduler
(wt:shutdown-wheel-timer scheduler)
(setf scheduler nil)))
(ac:shutdown (user-actor-context self) :wait wait)
(ac:shutdown (internal-actor-context self) :wait wait))

Expand Down
4 changes: 3 additions & 1 deletion tests/actor-system-test.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ We use internal API here only for this test, do not use this otherwise."

(ac:shutdown system)
(is-true (await-cond 2.0
(= 0 (length (ac:all-actors system)))))))
(= 0 (length (ac:all-actors system)))))
(is-false (asys::timeout-timer system))
(is-false (asys::scheduler system))))

(test shutdown-system--with-wait
"Test shutting down the system by waiting for all actor to stop."
Expand Down

0 comments on commit f97bdcf

Please sign in to comment.