Repository navigation
Mark all channels inactive when a large IOC disconnects - #192
Open
anderslindho wants to merge 2 commits into
Open
anderslindho wants to merge 2 commits into
anderslindho wants to merge 2 commits into
Conversation
Only the first `findSizeLimit` channels of an IOC (10,000 by default) were marked `Inactive` when it disconnected. The rest stayed `Active` until the next clean by `cleanOnStart`, `cleanOnStop` or `recceiver-clean`. The recCeiver gets the channels of an IOC from ChannelFinder with one `iocid` query. It marks the channels in that result `Inactive`, and no others. The query was capped at `findSizeLimit` and not paged. The query now pages with `~search_after` on disconnect. ChannelFinder sorts results by name, and `~search_after` starts the next page after a given name. `~from` could not be used because ChannelFinder rejects a query past the Elasticsearch result window, which is 10,000 by default. Paging is only done for a disconnect or a commit without records. A connected commit with records does not need the full list. Its channels past the first page are found by name, so it still makes one capped query. A large IOC that uploads in batches makes one query per batch, as before. `~search_after` needs ChannelFinder 4.7.0. Older versions read the parameter as a property filter and return an empty second page. The result is then the first page only, as before this change. The paging also stops with a warning if a page starts or ends at or before the last name of the previous page.
The example configs said an unset `findSizeLimit` falls back to the ChannelFinder default. The recCeiver uses its own default of 10,000 instead. The comment now says so. It also says that marking more channels than the limit `Inactive` on disconnect needs ChannelFinder 4.7.0 or newer.
|
jacomago
reviewed
Nov 18, 2026
| A page is requested while the previous one came back full. With a size limit of 0 the single | ||
| query carries no `~size`, so ChannelFinder applies its own cap. | ||
| """ | ||
| args = [(CFPropertyName.IOC_ID.value, iocid)] |
Contributor
There was a problem hiding this comment.
Should probably also add the recciever_id intot he filter.
Should we make this more generic and combine with the clean code?
Contributor
Author
There was a problem hiding this comment.
On combining with clean_service: I'd rather not build on that, I think the sweep should go away once CF can tell that a recCeiver is gone. But I can add the recceiver_id. Fine?
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.



Only the first
findSizeLimitchannels of an IOC (10,000 by default) were markedInactivewhen it disconnected - the rest stayedActive(until the next clean bycleanOnStart,cleanOnStoporrecceiver-clean).The recCeiver gets the channels of an IOC from ChannelFinder with one
iocidquery. It marks the channels in that resultInactive, and no others. The query was capped atfindSizeLimitand not paged. It now pages with~search_afteron disconnect. ChannelFinder sorts results by name, and~search_afterstarts the next page after a given name.~fromcould not be used because ChannelFinder rejects a query past the Elasticsearch result window, which is 10,000 by default.Paging is only done for a disconnect or a commit without records. A connected commit with records does not need the full list. Its channels past the first page are found by name, so it still makes one capped query. A large IOC that uploads in batches makes one query per batch, as before.
~search_afterneeds ChannelFinder 4.7.0. Older versions read the parameter as a property filter and return an empty second page. The result is then the first page only, as before this change. The paging also stops with a warning if a page starts or ends at or before the last name of the previous page.The second commit corrects the
findSizeLimitcomment in the example configs. It said an unset value falls back to the ChannelFinder default, but the recCeiver uses its own default of 10,000.