Repository navigation
Release 0.3.0 - #36
Merged
Merged
Conversation
Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release 0.3.0, then 0.4.0-SNAPSHOT.
Merge with a merge commit or a rebase, not a squash: the commit "Release 0.3.0" has to reach
mainunchanged,etc/release.sh releasetags it there.Release notes, from CHANGELOG.md:
POLL delivery that survives restarts and runs on several instances: acknowledgements wait in a
store, optionally in the database, long polling keeps a request outstanding, and a SET is claimed
while its handlers run so that two instances never acknowledge a SET one of them failed on.
The JDBC schema gained a column and a table; migration scripts and startup upgrades come with it.
Handlers get typed access to CAEP and RISC events with
SsfCaepEventHandlerandSsfRiscEventHandler,and the documentation now says in plain words that processing is at least once, with
idempotencyKey()as the key for a handler's side effects.
Added
POLL delivery keeps the acknowledgements and error reports it owes the transmitter in an
SsfPollAckStoreuntil a poll request has carried them: in memory by default, or durably withJdbcSsfPollAckStore(tableEASYSSF_POLL_ACK, auto-configured with the other JDBC stores,easyssf.receiver.jdbc.ack-retention), so that a SET handled right before a restart isacknowledged afterwards instead of being delivered again.
SsfPoller.stop()sends the pendingacknowledgements with a last request; the health details show them as
pendingAcksand thegauge
easyssf.receiver.poll.pending-ackscounts them.Long polling (RFC 8936, section 2.5):
SsfPoller.setLongPolling(hold)keeps one requestoutstanding that the transmitter holds until SETs are available;
easyssf.receiver.poll.long-pollingand
poll.long-polling-holdin the Spring Boot starter, off by default.SsfHttpRequestcarries anoptional timeout per request.
TestTransmitterholds long polls forsetLongPollHold.SsfPoller.setThreadFactorylets a framework create the polling thread, or use a virtual one.A SET is claimed in the
SsfJtiDedupStorewhile its handlers run (Claim.IN_PROGRESS): anotherinstance that receives it meanwhile neither handles nor acknowledges it (
SsfSetInProgressException,metrics outcome
in_progress), so a handler failure on the first instance is not masked. A claimolder than the lease (
easyssf.receiver.dedup.lease, 60 seconds) counts as abandoned and the SET ishandled again. The claim carries a token that fences it: an instance whose handlers outlived the
lease can neither complete nor forget the claim of the instance that took the SET over.
SsfEventToken.idempotencyKey()andSsfEventContext.idempotencyKey(), the issuer andjtiof aSET, as the key for the side effects of a handler: processing is at least once, which the
documentation now says in those words.
Typed CAEP and RISC events:
SsfCaepEventHandlerandSsfRiscEventHandlerdispatch the events of aSET to a method per event (
onSessionRevoked,onAssuranceLevelChange,onAccountDisabled, ...),with
SsfCaepEventandSsfRiscEventfromeasyssf-corefor the claims the specifications define(
eventTimestamp(),initiatingEntity(), the localizedreasonAdmin()andreasonUser(),credentialType(),currentLevel(),changeDirection(),reason(),newValue(), ...). An eventtype in the CAEP or RISC namespace that easyssf does not know yet is
SsfCaepEventKind.OTHERorSsfRiscEventKind.OTHERand reachesonOtherCaepEventoronOtherRiscEvent.SsfEventContext.eventForstays for raw access.
SsfEventTypesgainedRiscSessionsRevoked(deprecated by RISC, still sent) andisCaepEvent/isRiscEvent;SsfEventTimestampsreads anevent_timestampin seconds or milliseconds.Schema migration:
easyssf-receiver-jdbcships versioned migration scripts inorg/easyssf/receiver/jdbc/migration/(Flyway naming, plain SQL), andJdbcSsfSchema.prepareTableadds the columns a release introduced to an existing table where it may create tables
(
initialize-schemaembeddedoralways); otherwise it names the statements to run.Changed
SsfJtiDedupStorehasclaim, which returns aClaimwith theStateof the SET and the token ofthe claim granted, and
processedandforget, which take that claim;seenBeforeis a deprecateddefault method. The table
EASYSSF_PROCESSED_SETgained the columnSTATE; existing tables needALTER TABLE EASYSSF_PROCESSED_SET ADD STATE VARCHAR(16) DEFAULT 'PROCESSED' NOT NULL(the migrationscript
V0_3_0__dedup_state_and_poll_acks.sql), applied on startup where tables may be created andnamed in the error otherwise.
easyssf-receiver-jdbchas a third table,EASYSSF_POLL_ACK; create it with thestatements of
schema.sqlwhere the tables are not created on startup.SsfPollerpolls on a thread of its own instead of a scheduled executor, and the in-memory storeslock with
ReentrantLockinstead ofsynchronized, which pins virtual threads before JDK 24.SsfJdbcOperations.query(sql, maxRows, mapper, args)limits a result through the JDBC driver, sothe stores need no dialect-specific SQL; the JDBC stores are now tested on MySQL as well as on H2
and PostgreSQL.