More careful return values when adding data to aeron buffer

This commit is contained in:
Robinson 2023-10-18 19:54:33 +02:00
parent 7cacc63dca
commit c38fa13f11
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 4 additions and 3 deletions

View File

@ -864,12 +864,14 @@ class AeronDriver(config: Configuration, val logger: Logger, val endPoint: EndPo
// extra checks performed BECAUSE we have to do our own data fragmentation management.
// It doesn't make sense to use `.offer`, which ALSO has its own fragmentation handling (which is extra overhead for us)
bufferClaim.buffer().putBytes(DataHeaderFlyweight.HEADER_LENGTH, internalBuffer, offset, objectSize)
return true
} catch (e: Exception) {
logger.error("Error adding data to aeron buffer.", e)
return false
} finally {
// must commit() or abort() before the unblock timeout (default 15 seconds) occurs.
bufferClaim.commit()
}
return true
}
if (internal.mustRestartDriverOnError) {
@ -966,7 +968,6 @@ class AeronDriver(config: Configuration, val logger: Logger, val endPoint: EndPo
listenerManager.notifyError(exception)
return false
}
}
/**