GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 1. deprecate IoUringIoEvent.data() · netty/netty@d009fdb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • transport-classes-io_uring/src/main/java/io/netty/channel/uring
    • AbstractIoUringChannel.java
    • IoUringIoEvent.java
    • IoUringIoHandler.java
  • transport-native-io_uring/src/test/java/io/netty/channel/uring
    • IoUringCustomIoHandleTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringChannel.java‎

Copy file name to clipboardExpand all lines: transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringChannel.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public final void handle(IoRegistration registration, IoEvent ioEvent) {
455455
byte op = event.opcode();
456456
int res = event.res();
457457
int flags = event.flags();
458-
short data = event.data();
458+
short data = (short) event.userData();
459459
switch (op) {
460460
case Native.IORING_OP_RECV:
461461
case Native.IORING_OP_ACCEPT:
Collapse file

‎transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringIoEvent.java‎

Copy file name to clipboardExpand all lines: transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringIoEvent.java
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ public final class IoUringIoEvent implements IoEvent {
3838
* @param flags the flags
3939
* @param opcode the op code
4040
* @param data the user data that was given as part of the submission.
41+
* @deprecated use {@link #IoUringIoEvent(int,int,byte,long)} instead.
4142
*/
43+
@Deprecated
4244
public IoUringIoEvent(int res, int flags, byte opcode, short data) {
4345
this(res, flags, opcode, (long) data);
4446
}
@@ -98,7 +100,9 @@ public byte opcode() {
98100
* Returns the data that is passed as part of {@link IoUringIoOps}.
99101
*
100102
* @return data.
103+
* @deprecated use {@link #userData()} instead.
101104
*/
105+
@Deprecated
102106
public short data() {
103107
return (short) userData;
104108
}
Collapse file

‎transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringIoHandler.java‎

Copy file name to clipboardExpand all lines: transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringIoHandler.java
+18-12Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -313,19 +313,21 @@ private void handle(int res, int flags, long udata, ByteBuffer extraCqeData) {
313313
ringBuffer.fd(), Native.opToStr(op), userData, res);
314314
}
315315

316-
// Resolve slow-path completions through the live registration table to align with the fast path.
317-
if (registration != null) {
318-
registration.handle(res, flags, op, userData, extraCqeData);
319-
}
320-
321316
// Recycle if this completion is terminal (no more CQEs expected for this SQE).
322317
if (oneshotOp) {
323318
pendingOps.release(slot);
324319
}
320+
321+
// Resolve slow-path completions through the live registration table to align with the fast path.
322+
if (registration != null) {
323+
registration.handle(res, flags, op, userData, extraCqeData);
324+
}
325325
return;
326326
}
327-
328-
logger.debug("ignoring completion for unknown sequence (seq={}, res={})", udata, res);
327+
if (logger.isDebugEnabled()) {
328+
logger.debug("ignoring completion for unknown sequence (seq={}, res={})",
329+
PendingOpSlots.tokenSequence(udata), res);
330+
}
329331
} catch (Error e) {
330332
throw e;
331333
} catch (Throwable throwable) {
@@ -502,13 +504,17 @@ public IoRegistration register(IoHandle handle) throws Exception {
502504
if (shuttingDown) {
503505
throw new IllegalStateException("IoUringIoHandler is shutting down");
504506
}
507+
int startId = nextRegistrationId;
505508
DefaultIoUringIoRegistration registration = new DefaultIoUringIoRegistration(executor, ioHandle);
506509
for (;;) {
507510
int id = nextRegistrationId();
508511
DefaultIoUringIoRegistration old = registrations.put(id, registration);
509512
if (old != null) {
510513
assert old.handle != registration.handle;
511514
registrations.put(id, old);
515+
if (nextRegistrationId == startId) {
516+
throw new IllegalStateException("registration id space exhausted");
517+
}
512518
} else {
513519
registration.setId(id);
514520
ioHandle.registered();
@@ -520,10 +526,10 @@ public IoRegistration register(IoHandle handle) throws Exception {
520526
}
521527

522528
private int nextRegistrationId() {
523-
int id = nextRegistrationId++;
524-
if (id <= 0) {
525-
throw new IllegalStateException("registration id overflow");
526-
}
529+
//registrationId must stay positive because id > 0
530+
//it is used to distinguish normal fast-path completions from non-registration tokens.
531+
int id = nextRegistrationId;
532+
nextRegistrationId = id == Integer.MAX_VALUE ? 1 : id + 1;
527533
return id;
528534
}
529535

@@ -596,7 +602,7 @@ private void submitSlowPath0(IoUringIoOps ioOps, long token, long userData) {
596602
}
597603

598604
private boolean canUseFastPath(long userData) {
599-
return (short) userData == userData;
605+
return ((short) userData) == userData;
600606
}
601607

602608
@SuppressWarnings("unchecked")
Collapse file

‎transport-native-io_uring/src/test/java/io/netty/channel/uring/IoUringCustomIoHandleTest.java‎

Copy file name to clipboardExpand all lines: transport-native-io_uring/src/test/java/io/netty/channel/uring/IoUringCustomIoHandleTest.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2025 The Netty Project
2+
* Copyright 2026 The Netty Project
33
*
44
* The Netty Project licenses this file to you under the Apache License,
55
* version 2.0 (the "License"); you may not use this file except in compliance

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.