Skip to content

feat: add new supported phases to supported_semaphore_wait_phases#13

Open
HanadaLee wants to merge 1 commit into
api7:masterfrom
HanadaLee:supported_semaphore_wait_phases
Open

feat: add new supported phases to supported_semaphore_wait_phases#13
HanadaLee wants to merge 1 commit into
api7:masterfrom
HanadaLee:supported_semaphore_wait_phases

Conversation

@HanadaLee
Copy link
Copy Markdown

@HanadaLee HanadaLee commented Apr 8, 2026

These newly added phases in Lua support supported_semaphore_wait_phases.

Summary by CodeRabbit

  • Bug Fixes
    • Extended DNS query synchronization support to additional Nginx execution contexts for improved reliability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

📝 Walkthrough

Walkthrough

Modified the DNS client semaphore-wait phase whitelist by adding five OpenResty execution phases: server_rewrite, precontent, proxy_ssl_cert, proxy_ssl_verify, and ssl_client_hello to the supported_semaphore_wait_phases configuration.

Changes

Cohort / File(s) Summary
Semaphore Wait Phases Extension
src/resty/dns/client.lua
Added five OpenResty phases to supported_semaphore_wait_phases: server_rewrite, precontent, proxy_ssl_cert, proxy_ssl_verify, and ssl_client_hello, enabling semaphore blocking in additional Nginx execution contexts.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
E2e Test Quality Review ⚠️ Warning PR adds five new OpenResty phases to supported_semaphore_wait_phases whitelist without any test coverage for these changes. Add comprehensive test cases validating each newly added phase and include inline code comments explaining safety for semaphore waiting in those phases.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding new supported phases to the supported_semaphore_wait_phases list, which aligns with the changeset's core purpose.
Security Check ✅ Passed PR safely expands OpenResty execution phases for DNS query synchronization without introducing security vulnerabilities across all seven critical categories.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/resty/dns/client.lua (1)

862-875: ⚠️ Potential issue | 🔴 Critical

Remove unsupported phases from supported_semaphore_wait_phases.

According to the official lua-resty-core documentation, semaphore:wait() is supported only in these phases:

  • rewrite_by_lua* (rewrite)
  • access_by_lua* (access)
  • content_by_lua* (content)
  • ngx.timer.* (timer)

The five newly added phases (server_rewrite, precontent, proxy_ssl_cert, proxy_ssl_verify, ssl_client_hello) are not in the supported list and will cause semaphore:wait() to fail if called in those contexts. Remove them from this table.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/resty/dns/client.lua` around lines 862 - 875,
supported_semaphore_wait_phases currently includes unsupported phases which will
cause semaphore:wait() to fail; update the supported_semaphore_wait_phases table
(the variable named supported_semaphore_wait_phases) to remove the five
unsupported entries server_rewrite, precontent, proxy_ssl_cert,
proxy_ssl_verify, and ssl_client_hello so that the table only contains the
phases that lua-resty-core supports for semaphore:wait() (rewrite, access,
content, timer).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/resty/dns/client.lua`:
- Around line 862-875: supported_semaphore_wait_phases currently includes
unsupported phases which will cause semaphore:wait() to fail; update the
supported_semaphore_wait_phases table (the variable named
supported_semaphore_wait_phases) to remove the five unsupported entries
server_rewrite, precontent, proxy_ssl_cert, proxy_ssl_verify, and
ssl_client_hello so that the table only contains the phases that lua-resty-core
supports for semaphore:wait() (rewrite, access, content, timer).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6f73b93e-decb-4b3e-8784-215d90f3e6ce

📥 Commits

Reviewing files that changed from the base of the PR and between 0449c22 and 06482fa.

📒 Files selected for processing (1)
  • src/resty/dns/client.lua

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.

1 participant