Skip to content

dump_offload: prevent connection rejection from terminating active of… - #1513

Open
abhilashraju wants to merge 1 commit into
ibm-openbmc:1120from
abhilashraju:fix_for_807208_dump_offload
Open

dump_offload: prevent connection rejection from terminating active of…#1513
abhilashraju wants to merge 1 commit into
ibm-openbmc:1120from
abhilashraju:fix_for_807208_dump_offload

Conversation

@abhilashraju

Copy link
Copy Markdown
Contributor

…fload

When a dump offload is already in progress, any subsequent offload request is rejected with a "503 Service Unavailable" error and the rejected connection is closed.

However, bmcweb uses a shared static systemHandlers pointer, the .onclose callback (which is registered for all connections on the dump attachment route) gets triggered when the newly rejected connection is closed. Since systemHandlers is not null, the callback would execute the cleanup logic, cancel active async socket reads, remove socket files, and nullify systemHandlers. This abruptly terminates the ongoing (first) offload transfer and leaves subsequent attempts wedged.

This commit resolves the issue by verifying if the connection being closed (conn) matches the active connection registered in the active handler (systemHandlers->connection). If the closed connection is a non-active connection (such as a rejected parallel request), the cleanup logic is skipped and the handler remains active.

Tested:

  1. Initiated a non-disruptive system dump offload from ASMI.
  2. Attempted a second offload from a new ASMI tab/browser.
  3. Verified the second request is gracefully rejected with a 503 Service Unavailable without interrupting the first active offload which continues to completion.
  4. Subsequent offloads can be successfully initiated and completed.

@asmithakarun

Copy link
Copy Markdown
Contributor

Changes looks good.
This might be needed for 1210 as well, as it shares the same code!

@asmithakarun

Copy link
Copy Markdown
Contributor

@asmithakarun

Copy link
Copy Markdown
Contributor

@abhilashraju there seems to be clang formatting issues that CI is reporting. Can you check and resolve?

…fload

When a dump offload is already in progress, any subsequent offload
request is rejected with a "503 Service Unavailable" error and the
rejected connection is closed.

However, since `bmcweb` runs on a single thread and uses a shared static
`systemHandlers` pointer, the `.onclose` callback (which is registered
for all connections on the dump attachment route) gets triggered when the
newly rejected connection is closed. Since `systemHandlers` is not null,
the callback would execute the cleanup logic, cancel active async socket
reads, remove socket files, and nullify `systemHandlers`. This abruptly
terminates the ongoing (first) offload transfer and leaves subsequent
attempts wedged.

This commit resolves the issue by verifying if the connection being
closed (`conn`) matches the active connection registered in the active
handler (`systemHandlers->connection`). If the closed connection is a
non-active connection (such as a rejected parallel request), the
cleanup logic is skipped and the handler remains active.

Tested:
1. Initiated a non-disruptive system dump offload from ASMI.
2. Attempted a second offload from a new ASMI tab/browser.
3. Verified the second request is gracefully rejected with a 503
   Service Unavailable without interrupting the first active offload
   which continues to completion.
4. Subsequent offloads can be successfully initiated and completed.

Signed-off-by: Abhilash Raju <abhilash.kollam@gmail.com>
@abhilashraju
abhilashraju force-pushed the fix_for_807208_dump_offload branch from da39e01 to 712f382 Compare August 19, 2026 17:19
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