Skip to content

Nk0273926 patch 1 - #13632

Open
nk0273926 wants to merge 5 commits into
appwrite:mainfrom
nk0273926:nk0273926-patch-1
Open

Nk0273926 patch 1#13632
nk0273926 wants to merge 5 commits into
appwrite:mainfrom
nk0273926:nk0273926-patch-1

Conversation

@nk0273926

Copy link
Copy Markdown

What does this PR do?

This PR adds SWOOLE_HOOK_ALL to the Swoole HTTP server settings.

This is intended to address the synchronous function execution deadlock
described in issue #13485.

I have not yet verified the fix with a concurrency test. The existing
custom dispatch function and SWOOLE_DISPATCH_UIDMOD setting are unchanged.

Test Plan

  • Added Constant::OPTION_HOOK_FLAGS => SWOOLE_HOOK_ALL to the Swoole HTTP server settings.
  • I have not run concurrency tests or verified the fix in a running Appwrite instance yet.
  • The existing custom dispatch function and SWOOLE_DISPATCH_UIDMOD setting are unchanged.

Related PRs and Issues

Checklist

nk0273926 and others added 5 commits July 15, 2026 23:43
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR appears safe to merge after non-blocking test and cleanup improvements; no concrete runtime regression was established.

Fix All in Claude CodeFindings

  1. P2 Concurrency behavior remains untested
  2. P2 Account data remains captured
Fix with agent prompt
### Issue 1
app/http.php:63
This runtime-wide hook change is intended to resolve a concurrency deadlock, but the PR adds no observable concurrency test. Because `SWOOLE_HOOK_ALL` changes blocking I/O behavior across every HTTP request, please exercise parallel synchronous executions and assert that both complete without deadlocking. A test that merely inspects this configuration value would not validate the fix.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 2
src/Appwrite/Platform/Tasks/Install.php:878
Removing `name` and `email` from telemetry leaves the entire `$account` argument unused here, while both callers still pass it and the coroutine closure still captures it. This needlessly extends the lifetime of account data, including the installer password. Remove the parameter and its call-site captures now that telemetry no longer consumes it.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

  • Applies SWOOLE_HOOK_ALL through the HTTP server settings.
  • Preserves the existing custom dispatch function and UID-based dispatch mode.
  • Stops including administrator identity fields in install and upgrade analytics.
  • Still needs an observable concurrency regression test and cleanup of the now-unused account telemetry argument.

Reviews (1) · Last reviewed commit: "Add SWOOLE_HOOK_ALL to HTTP server setti..."

Comment thread app/http.php
port: System::getEnv('PORT', 80),
settings: [
Constant::OPTION_WORKER_NUM => $totalWorkers,
Constant::OPTION_HOOK_FLAGS => SWOOLE_HOOK_ALL,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Concurrency behavior remains untested

This runtime-wide hook change is intended to resolve a concurrency deadlock, but the PR adds no observable concurrency test. Because SWOOLE_HOOK_ALL changes blocking I/O behavior across every HTTP request, please exercise parallel synchronous executions and assert that both complete without deadlocking. A test that merely inspects this configuration value would not validate the fix.

Knowledge Base Used: Application bootstrap and runtime lifecycle

Prompt To Fix With AI
This is a comment left during a code review.
Path: app/http.php
Line: 63

Comment:
**Concurrency behavior remains untested**

This runtime-wide hook change is intended to resolve a concurrency deadlock, but the PR adds no observable concurrency test. Because `SWOOLE_HOOK_ALL` changes blocking I/O behavior across every HTTP request, please exercise parallel synchronous executions and assert that both complete without deadlocking. A test that merely inspects this configuration value would not validate the fix.

**Knowledge Base Used:** [Application bootstrap and runtime lifecycle](https://app.greptile.com/appwrite/-/custom-context/knowledge-base/appwrite/appwrite/-/docs/application-bootstrap.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Codex

$database = $input['_APP_DB_ADAPTER'] ?? 'postgresql';
$name = $account['name'] ?? 'Admin';
$email = $account['email'] ?? 'admin@selfhosted.local';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Account data remains captured

Removing name and email from telemetry leaves the entire $account argument unused here, while both callers still pass it and the coroutine closure still captures it. This needlessly extends the lifetime of account data, including the installer password. Remove the parameter and its call-site captures now that telemetry no longer consumes it.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Appwrite/Platform/Tasks/Install.php
Line: 878

Comment:
**Account data remains captured**

Removing `name` and `email` from telemetry leaves the entire `$account` argument unused here, while both callers still pass it and the coroutine closure still captures it. This needlessly extends the lifetime of account data, including the installer password. Remove the parameter and its call-site captures now that telemetry no longer consumes it.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

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