Skip to content

feat(heartbeat): add the HeartbeatStateMachine - #174

Merged
nickkkccc merged 3 commits into
masterfrom
add-heartbeat-state-machine
Nov 19, 2026
Merged

nickkkccc merged 3 commits into
masterfrom
add-heartbeat-state-machine

Conversation

@nickkkccc

@nickkkccc nickkkccc commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

I haven't forgotten about:

  • Tests
  • Changelog
  • Documentation
    • JavaDoc was written
  • Commit messages comply with the guideline
  • Cleanup the code for review. See checklist

Related issues:

@nickkkccc
nickkkccc force-pushed the add-heartbeat-state-machine branch from 5291e46 to ae10944 Compare November 18, 2026 16:54
@nickkkccc
nickkkccc force-pushed the add-heartbeat-state-machine branch from ae10944 to ed92783 Compare November 19, 2026 09:49
}
}

private void sendIfNotLast(HeartbeatEvent expectedLast, PolicyEvent eventToSend) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Думаю, что compareWithLastAndSend будет понятнее. Потому что если перевести название метода, будет "отправить, если не последнее" - не очень понятно.

А вот compareWithLastAndSend - понятнее - "сравнить с последним, и отправить, если не равно". Подобно compareAndSet у атомарных переменных.

Или что-то вроде sendIfNotComparedWithLast. В общем, можно подумать над другими вариантами

}
}

private static Throwable unwrap(Throwable ex) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Забыл убрать? Почти точная копия есть теперь в CFUtils

@nickkkccc
nickkkccc force-pushed the add-heartbeat-state-machine branch from ed92783 to 9d2a188 Compare November 19, 2026 13:42
 An implementation of the `HeartbeatMachine` has been added; it serves
 as a redesigned version of the heartbeat mechanism used in
 `PoolEntry`.

 This implementation utilizes an event-driven state machine based on:
  - `io.tarantool.core.state.AbstractDrainLoopMachine.java`
  - `io.tarantool.core.state.Event`
  - `io.tarantool.core.state.State`
 - Tests have been added to verify the functionality of the
   HeartbeatStateMachine state machine.
 - Added a test class to verify heartbeat window evaluation logic and
   connection state transitions.
@nickkkccc
nickkkccc force-pushed the add-heartbeat-state-machine branch from 9d2a188 to 6a4bea3 Compare November 19, 2026 13:46
@nickkkccc
nickkkccc merged commit 1489359 into master Nov 19, 2026
8 checks passed
@nickkkccc
nickkkccc deleted the add-heartbeat-state-machine branch November 19, 2026 14:35
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