Repository navigation
Conversation
When QPL fails to retrieve PCK certificates (e.g., HTTP 404 from PCCS), the QGS context was not being released, causing all subsequent quote requests to fail until the service was restarted. This fix ensures context is released on failure at all critical points: qgs_ql_logic.cpp: - Release context when tee_att_init_quote fails (first request) - Release context when tee_att_get_quote_size/get_quote fails (subsequent requests with existing context) network_wrapper.cpp (Linux & Windows): - Add error logging for HTTP 404 (no cache data) with full URL - Add error logging for unexpected HTTP status codes The root cause was that HTTP 404 errors from PCCS (indicating no certificate data available) left the context in a corrupted state. With this fix, the next request will automatically re-initialize the context and retry.
Leechael
force-pushed
the
fix/qgsd-context-recovery-on-network-error
branch
from
December 25, 2025 16:33
2a7c69f to
96d3811
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Recovery cleanup does not cover all network-backed request paths.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Improves QGS recovery from transient PCCS/network failures and adds HTTP diagnostics.
Changes:
- Reset thread-local QGS contexts after quote failures.
- Add PCCS failure logging on Windows and Linux.
- Refine Linux HTTP error handling.
File summaries
| File | Description |
|---|---|
QuoteGeneration/quote_wrapper/qgs/qgs_ql_logic.cpp |
Adds context cleanup after failures. |
QuoteGeneration/qcnl/win/network_wrapper.cpp |
Logs PCCS HTTP failures on Windows. |
QuoteGeneration/qcnl/linux/network_wrapper.cpp |
Logs PCCS HTTP failures on Linux. |
Review details
Suppressed comments (1)
QuoteGeneration/qcnl/win/network_wrapper.cpp:98
pccs_status_codeis aDWORD(anunsigned longon Windows), but this format string uses%ld, which asksqcnl_log/vsnprintfto read alongfrom the variadic arguments. Use the unsigned format used fordwStatusbelow to avoid a format/type mismatch in the new diagnostic.
qcnl_log(SGX_QL_LOG_ERROR, "[QCNL] PCCS returned unexpected HTTP status: %ld\n", pccs_status_code);
- Files reviewed: 3/3 changed files
- Comments generated: 1
- 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 on lines
+200
to
+201
| if (resp_error_code != QGS_MSG_SUCCESS) { | ||
| ptr.reset(); |
This branch has not been deployed
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.
Fix QGS daemon's inability to auto-recover from temporary network errors (e.g., PCCS returning unexpected HTTP status codes or connection timeouts).
Related issue: #450