Skip to content

Add deliberate crash just to demo recovery - #4

Merged
lgmfred merged 1 commit into
mainfrom
crash-recovery-demo
Jun 6, 2026
Merged

Add deliberate crash just to demo recovery#4
lgmfred merged 1 commit into
mainfrom
crash-recovery-demo

Conversation

@lgmfred

@lgmfred lgmfred commented Jun 6, 2026

Copy link
Copy Markdown
Owner

:player2's token must land on row 4, col 6 to simulate a crash as below

        col 0  1  2  3  4  5  6
row 0       .  .  .  .  .  .  .
row 1       .  .  .  .  .  .  .
row 2       .  .  .  .  .  .  .
row 3       .  .  .  .  .  .  .
row 4       .  .  .  .  .  .  X  <- player2 must land here
row 5       .  .  .  .  .  .  O  <- must already be occupied

This sequence of function calls in elixir shell, for example, would produce this crash and you see the game server restarted with a new PID;

iex(1)> game_id = "crash-demo-2"
iex(2)> {:ok, pid} = ConnectFour.create_game(game_id, "Player 1")
iex(3)> :ok = ConnectFour.join_game(game_id, "Player 2")
iex(4)> :no_win = ConnectFour.drop_token(game_id, :player1, 0)
iex(5)> :no_win = ConnectFour.drop_token(game_id, :player2, 1)
iex(6)> :no_win = ConnectFour.drop_token(game_id, :player1, 6)
iex(7)> ConnectFour.drop_token(game_id, :player2, 6)

`player2`'s token must land on row 4, col 6 to simulete a crash as below

```shell
        col 0  1  2  3  4  5  6
row 0       .  .  .  .  .  .  .
row 1       .  .  .  .  .  .  .
row 2       .  .  .  .  .  .  .
row 3       .  .  .  .  .  .  .
row 4       .  .  .  .  .  .  X  <- player2 must land here
row 5       .  .  .  .  .  .  O  <- must already be occupied
```
@lgmfred
lgmfred force-pushed the crash-recovery-demo branch from 493c5df to 19631c5 Compare June 6, 2026 10:43
@lgmfred
lgmfred merged commit 19631c5 into main Jun 6, 2026
2 checks passed
@lgmfred
lgmfred deleted the crash-recovery-demo branch June 6, 2026 10:50
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.

1 participant