Skip to content

Fix intermittent universe-restart.rkt DrDr failure#252

Merged
mfelleisen merged 1 commit intoracket:masterfrom
samth:fix-universe-restart-drdr
Jan 22, 2026
Merged

Fix intermittent universe-restart.rkt DrDr failure#252
mfelleisen merged 1 commit intoracket:masterfrom
samth:fix-universe-restart-drdr

Conversation

@samth
Copy link
Member

@samth samth commented Jan 22, 2026

Handle network errors in broadcast when universe drops a world.

When a universe drops a world by closing the TCP connection, subsequent attempts by the world to send messages would raise a "Broken pipe" error. This caused intermittent test failures in universe-restart.rkt.

The fix catches exn:fail:network? in the broadcast function and sets *out* to #f, preventing the exception from propagating.

Example failure: https://drdr.racket-lang.org/71877/racket/share/pkgs/htdp-test/2htdp/tests/universe-restart.rkt

(when *out*
(check-result 'send sexp? "Sexp expected; given ~e\n" msg)
(tcp-send *out* msg)))
(with-handlers ([exn:fail:network? (lambda (e) (set! *out* #f))])
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes!

@mfelleisen
Copy link
Contributor

Thanks!

@mfelleisen mfelleisen merged commit 8c2c531 into racket:master Jan 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants