Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 25 minutes and 7 seconds.Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39dad49fb4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| using var cts = CancellationTokenSource.CreateLinkedTokenSource(ct); | ||
| cts.CancelAfter(TimeSpan.FromSeconds(_config.GracefulTimeoutSecs)); | ||
| var result = await Cli.Wrap(_config.PgCtlPath) | ||
| .WithArguments(new[] { "-D", _config.DataDir, "stop", "-m", "fast" }) | ||
| .WithValidation(CommandResultValidation.None) | ||
| .ExecuteBufferedAsync(cts.Token); |
There was a problem hiding this comment.
Ensure stop cleanup runs when pg_ctl times out
If pg_ctl stop takes longer than GracefulTimeoutSecs, ExecuteBufferedAsync(cts.Token) throws OperationCanceledException and this method exits before disposing _process and restoring _state from Stopping. That leaves the module in a stuck transitional state (and can block future starts because StartAsync only allows Stopped/Crashed). Wrap the pg_ctl call in try/finally (or catch timeout explicitly) so state reconciliation and handle cleanup always run.
Useful? React with 👍 / 👎.
| var result = await Cli.Wrap(_config.PgCtlPath) | ||
| .WithArguments(new[] { "-D", _config.DataDir, "stop", "-m", "fast" }) | ||
| .WithValidation(CommandResultValidation.None) | ||
| .ExecuteBufferedAsync(cts.Token); | ||
| PublishBuffered(result); |
There was a problem hiding this comment.
Fail stop when pg_ctl returns a non-zero exit code
The stop path captures pg_ctl output but never checks result.ExitCode, then unconditionally sets the service to Stopped. When pg_ctl stop fails (bad datadir, permissions, stale PID state), the daemon will report PostgreSQL as stopped even though the server may still be running. Mirror StartAsync/ReloadAsync behavior by validating the exit code before transitioning state.
Useful? React with 👍 / 👎.
Adds a PostgreSQL service plugin with WDC-managed binary detection, initdb data directory initialization, pg_ctl start/stop/reload, pg_isready readiness checks, service status/logs, manifest, README, and icon.\n\nLocal verification:\n- dotnet restore NKS.WebDevConsole.Plugin.PostgreSQL/NKS.WebDevConsole.Plugin.PostgreSQL.csproj\n- dotnet build NKS.WebDevConsole.Plugin.PostgreSQL/NKS.WebDevConsole.Plugin.PostgreSQL.csproj -c Debug --no-restore\n- dotnet build NKS.WebDevConsole.Plugin.PostgreSQL/NKS.WebDevConsole.Plugin.PostgreSQL.csproj -c Release --no-restore --nologo\n- Debug build loop over all NKS.WebDevConsole.Plugin.* projects\n- git diff --check