Skip to content

nvmeof: change the return error code - #6535

Open
gadididi wants to merge 2 commits into
ceph:develfrom
gadididi:nvmeof/fix_error_code
Open

nvmeof: change the return error code#6535
gadididi wants to merge 2 commits into
ceph:develfrom
gadididi:nvmeof/fix_error_code

Conversation

@gadididi

@gadididi gadididi commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Return specific gRPC status codes from NVMe-oF resource creation and cleanup.
Preserve validation errors as InvalidArgument, duplicate resources as Aborted, and operational failures as Internal.
Propagate these errors through CreateVolume and DeleteVolume instead of wrapping them as generic internal errors.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow
    guidelines in the developer
    guide
    .
  • Reviewed the developer guide on Submitting a Pull
    Request
  • Pending release
    notes

    updated with breaking and/or notable changes for the next major release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

Show available bot commands

These commands are normally not required, but in case of issues, leave any of
the following bot commands in an otherwise empty comment in this PR:

  • /retest ci/centos/<job-name>: retest the <job-name> after unrelated
    failure (please report the failure too!)

fix the return error code from `createNVMeoFResources()`
and `cleanupNVMeoFResources` to be more accuratly.
return GRPc error code instead of they returned just
general internal error.

Signed-off-by: gadi-didi <gadi.didi@ibm.com>
@gadididi
gadididi requested a review from nixpanic September 3, 2026 12:10
@gadididi gadididi self-assigned this Sep 3, 2026
Copilot AI lite review requested due to automatic review settings September 3, 2026 12:10
@gadididi
gadididi requested a review from a team as a code owner September 3, 2026 12:10
@gadididi gadididi added the component/nvme-of Issues and PRs related to NVMe-oF. label Sep 3, 2026
@gadididi
gadididi requested a review from a team as a code owner September 3, 2026 12:10
@gadididi
gadididi removed request for a team September 3, 2026 12:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Client-visible error semantics changed without targeted unit tests, and there are misleading/less-informative error/log messages in the updated paths.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the NVMe-oF CSI controller to return more specific gRPC status codes from NVMe-oF resource creation and cleanup, and to propagate those errors through CreateVolume/DeleteVolume rather than re-wrapping them as generic Internal errors.

Changes:

  • Propagate NVMe-oF setup/cleanup errors from CreateVolume and DeleteVolume directly to preserve their gRPC codes.
  • Map parameter/validation failures to InvalidArgument, lock/contention cases to Aborted, and operational failures to Internal inside NVMe-oF resource create/cleanup paths.
File summaries
File Description
internal/nvmeof/controller/controllerserver.go Adjusts NVMe-oF create/cleanup error returns to use/propagate specific gRPC status codes.
Review details

Suppressed comments (1)

internal/nvmeof/controller/controllerserver.go:987

  • This cleanup path returns an error that will be surfaced directly to the CSI client; the new message "gateway connection failed" loses the earlier "for cleanup" context and can be confused with CreateVolume failures. Include cleanup context in the status message to make troubleshooting clearer.
	gateway, err := connectGateway(ctx, &nvmeof.GatewayConfig{
		Address: nvmeofData.GatewayManagementInfo.Address,
		Port:    nvmeofData.GatewayManagementInfo.Port,
	})
	if err != nil {
		return status.Errorf(codes.Internal, "gateway connection failed: %v", err)
	}
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/nvmeof/controller/controllerserver.go
Comment thread internal/nvmeof/controller/controllerserver.go
nixpanic
nixpanic previously approved these changes Sep 3, 2026

@nixpanic nixpanic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup!

@nixpanic
nixpanic requested a review from a team September 3, 2026 15:11
Madhu-1
Madhu-1 previously approved these changes Sep 4, 2026
@mergify

mergify Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This pull request now has conflicts with the target branch. Could you please resolve conflicts and force push the corrected changes? 🙏

@nixpanic

nixpanic commented Sep 8, 2026

Copy link
Copy Markdown
Member

@gadididi , this now has a conflict, can you please address it?

Signed-off-by: Gadi <58472718+gadididi@users.noreply.github.com>
@mergify
mergify Bot dismissed stale reviews from Madhu-1 and nixpanic September 9, 2026 08:13

Pull request has been modified.

@gadididi

gadididi commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@mergify rebase

@mergify

mergify Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

rebase

☑️ Nothing to do, the required conditions are not met

Details
  • -conflict [📌 rebase requirement]
  • -closed [📌 rebase requirement]
  • queue-position = -1 [📌 rebase requirement]
  • any of:
    • -linear-history [📌 rebase requirement]
    • #commits-behind > 0 [📌 rebase requirement]

@gadididi

gadididi commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

/queue

@ceph-csi-bot ceph-csi-bot added the ok-to-test Label to trigger E2E tests label Sep 9, 2026
@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/upgrade-tests-cephfs

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/upgrade-tests-rbd

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.36

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.36

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.36

@ceph-csi-bot ceph-csi-bot added ci/in-progress/e2e This label acts like a guard and prevents Mergify from adding the `ok-to-test` label again. and removed ok-to-test Label to trigger E2E tests labels Sep 9, 2026
@mergify mergify Bot removed the ci/in-progress/e2e This label acts like a guard and prevents Mergify from adding the `ok-to-test` label again. label Sep 9, 2026
@iPraveenParihar

Copy link
Copy Markdown
Contributor

/retest ci/centos/k8s-e2e-external-storage/1.34

@gadididi
gadididi requested review from Madhu-1 and nixpanic September 9, 2026 10:23
@gadididi

gadididi commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@nixpanic ,I addressed the conflict, need to reapprove, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup component/nvme-of Issues and PRs related to NVMe-oF.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants