Repository navigation
Describe usage sharing's session tracking, back-off and repeat interval - #97
Draft
jwrosewell wants to merge 2 commits into
Draft
jwrosewell wants to merge 2 commits into
jwrosewell wants to merge 2 commits into
Conversation
.NET's usage sharing builder has SetTrackSession, false by default, and SetAspSessionCookieName, which names the session cookie and has no effect unless session tracking is on. The configuration options listed neither, and the session tracking section did not say how the session cookie is used. The session tracking section now says how the session cookie is compared, and the accepted Evidence section says the filter accepts it so the tracker can read it, without sharing it. The table lists both options, and the five recovery settings the .NET builder still accepts, with .NET's defaults. The recovery settings have no effect, because usage sharing no longer has a back-off, and the text says so. The maximum queue size default is now the one .NET uses, 1000 or ten times the minimum entries per message if that is larger.
This was referenced Nov 7, 2026
Merged
Merged
The five recovery options now set a back-off that every usage sharing element MUST have, in place of the rows that said they have no effect. Repeated failed sends pause sending, never processing. Evidence is still queued during a pause, the first send after a pause is a trial that lengthens the pause if it fails, a success ends the back-off, and the queue drains as soon as a pause ends without waiting for more requests. Cleanup does not wait for a pause or send during one, and nothing is logged for each entry dropped from a full queue. The repeat Evidence interval is a sliding window that starts again each time Evidence is shared, so identical Evidence is shared at most once in each interval. The old text reset the lifetime each time matching Evidence was processed, which would stop Evidence seen continuously from ever being shared again, and .NET and Java followed neither.
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.
.NET is the model for usage sharing. This specification now describes what .NET's usage sharing builder and element do with sessions and lists every option the .NET builder has. It also makes a back-off after failed sends a requirement for every usage sharing element, and makes the repeat Evidence interval a sliding window that every language follows.
Problem
TrackerBase.Track(lines 114 to 132) stores a time only for a new entry, andShareUsageTracker.Match(lines 98 to 107) never moves it on, so a repeat is held back for the interval after it was first shared and then shared on every request until the entry leaves the cache. Java does the same (ShareUsageTracker.java). Python and Node store a new time when they share a repeat, so they share it at most once in each interval. None of them resets the time on every match, which would stop Evidence seen continuously from ever being shared again..NET, the reference
All links are to 51degrees-dotnet at rc commit f0fb06e.
SetTrackSession(bool), in ShareUsageBuilderBase.cs lines 543 to 560, says "If set to true, the configured session cookie will be used to identify user sessions. This will help to differentiate duplicate values that should not be shared." Its default isSHARE_USAGE_DEFAULT_TRACK_SESSION = false(Engines.FiftyOne/Constants.cs lines 88 to 95).SetAspSessionCookieName(string), in lines 514 to 527, says "This setting has no effect if TrackSession is false." Its default isDEFAULT_ASP_COOKIE_NAME = "asp.net_sessionid"(Engines/Constants.cs lines 49 to 53).trackSessionis true. When all Evidence is shared, all three accept every cookie and the session setting is not used. The cookie rule is in EvidenceKeyFilterShareUsage.cs lines 264 to 272.ShareUsageTracker_Session_Track), and without it once (ShareUsageTracker_Session_DoNotTrack).Change
asp.net_sessionidin .NET, which has no effect unless track session is on.The languages
For review
asp.net_sessionidand Java usesJSESSIONID(Constants.java line 27). Python and Node have no default (51degrees-python#50, 51degrees-node#35), so turning session tracking on there also needs the cookie named. The table gives .NET's default.Found, not changed
Checks
Documentation only. The diff adds the back-off section and the passages above, and changes the table rows for the repeat interval and the five recovery options. The new rows keep the table's column widths.
Related
setTrackSessionandsetSessionCookieName(ShareUsageBuilderBase.java lines 374 to 421), wired as .NET's are (ShareUsageBase.java lines 428 to 445).