Skip to content

libafpclient: avoid DSI synchronous teardown on server close - #343

Merged
rdmark merged 1 commit into
mainfrom
dsi-teardown
Aug 30, 2026
Merged

libafpclient: avoid DSI synchronous teardown on server close#343
rdmark merged 1 commit into
mainfrom
dsi-teardown

Conversation

@rdmark

@rdmark rdmark commented Aug 29, 2026

Copy link
Copy Markdown
Member

Handle an incoming DSICloseSession as transport loss. Do not flush or detach volumes from the DSI receiver, where those synchronous requests cannot receive replies and can free live FUSE fork records. Preserve local state for later reconnect.

@rdmark
rdmark requested a review from andylemin as a code owner August 29, 2026 08:46
@andylemin

andylemin commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

This is rather serendipitous!
I have a PR ready to go which fixes the CNID ID exhaustion bug in Netatalk, which needs this..

When the server runs out of IDs (exhausts primary key), it has no choice but to truncate the table and disconnect all users gracefully - so when users log back in, the CNID can be rebuilt automatically from scratch gracefully.

Hence it requires a new DB_RESET hint (and the PR to get ASP hooked up to IPC hints finally).

Granted it takes years to exhaust a 32bit primary key, but without the fix, Netatalk currently just hits a wall and becomes unusable until an admin knows they have to delete the CNID DB.

Handle an incoming DSICloseSession as transport loss. Do not flush or detach volumes from the DSI receiver, where those synchronous requests cannot receive replies and can free live FUSE fork records. Preserve local state for later reconnect.
@sonarqubecloud

Copy link
Copy Markdown

@rdmark

rdmark commented Aug 29, 2026

Copy link
Copy Markdown
Member Author

I'm looking forward to seeing the analysis and fix!

the 32 bit primary key exhaustion was on my mind when putting together the sqlite backend, and I simulated exhaustion by triggering the CNID_SQLITE_FLAG_DEPLETED (and CNID_MYSQL_FLAG_DEPLETED) flag by artificial means to observe the id recycling logic.

but I admittedly did not test the genuine 32 bit exhaustion, or any other sophisticated scenarios beyond the sanity test

@rdmark
rdmark merged commit ceb8051 into main Aug 30, 2026
23 checks passed
@rdmark
rdmark deleted the dsi-teardown branch August 30, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants