Skip to content

Add GRACEFUL_DISCONNECT event support (CEP-59) - #61

Open
Shanzita wants to merge 2 commits into
datastax:1.xfrom
Shanzita:cep-59
Open

Add GRACEFUL_DISCONNECT event support (CEP-59)#61
Shanzita wants to merge 2 commits into
datastax:1.xfrom
Shanzita:cep-59

Conversation

@Shanzita

Copy link
Copy Markdown

Adds the GRACEFUL_DISCONNECT event type and its codec, allowing clients to be notified in-band when a node begins draining connections for shutdown. The event has an empty body; the type string alone carries the signal.

Part of CEP-59: Graceful Disconnect - In-Band Connection Draining
for Node Shutdown. Driver-side handling: CASSJAVA-124.

Testing : mvn clean verify — 595 tests, 0 failures (JDK 8).

Adds the GRACEFUL_DISCONNECT event type and its codec, allowing
clients to be notified in-band when a node begins draining
connections for shutdown. The event has an empty body; the type
string alone carries the signal.

Part of CEP-59: Graceful Disconnect - In-Band Connection Draining
for Node Shutdown. Driver-side handling: CASSJAVA-124.
}

@Test
@UseDataProvider(location = TestDataProviders.class, value = "protocolV3OrAbove")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: GRACEFUL_DISCONNECT is only supported from v5 and above so it makes more sense to be

Suggested change
@UseDataProvider(location = TestDataProviders.class, value = "protocolV3OrAbove")
@UseDataProvider(location = TestDataProviders.class, value = "protocolV5OrAbove")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch — fixed in 62d0dfc, the test now uses protocolV5OrAbove.

@absurdfarce absurdfarce Aug 26, 2026

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.

I wondered about this too but this isn't really the case, is it? The spec has always allowed for other messages/events to be published, presumably so that other implementations of native-protocol could add on additional functionality. In fact that's why we're able to do this without requiring a new protocol version. So why would we constrain this to v5 only?

@SiyaoIsHiding SiyaoIsHiding left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Generally LGTM!
One concern about the specs in src/main/resources/. @absurdfarce How did we/should we keep those in sync with the server side spec? Do we change the CQL protocol spec here first, then make sure the server side PR align with ours?

GRACEFUL_DISCONNECT is only supported from protocol v5, per review feedback.
@absurdfarce

Copy link
Copy Markdown
Contributor

Good question @SiyaoIsHiding. The specs in src/main/resources are out-of-date and need a general overall update (that's what #46 aims to fix). But since this work isn't adding a new spec or changing any of the existing ones we shouldn't need to update anything for this PR.

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.

3 participants