Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the forked version #1

Merged
merged 345 commits into from
Nov 9, 2019
Merged
Changes from 1 commit
Commits
Show all changes
345 commits
Select commit Hold shift + click to select a range
874282d
Correct "msort()" vs "msortv()" to more fully stabilize transaction s…
Jun 17, 2019
2bc045b
Fix another stray "msort()/msortv()" issue
Jun 17, 2019
14b0765
In "Download Raw Diff", engage the chunk engine to handle 8MB+ changes
Jun 17, 2019
4af73a6
Don't require users be logged in to access the Logout controller, so …
Jun 13, 2019
4450c90
When triggering audits, respect committer identities when importing c…
Jun 17, 2019
bab35f2
Respect repository identities when selecting author vs auditor actions
Jun 17, 2019
aba7c98
Skip loading transaction handles in an old migration
Jun 5, 2019
731b45d
In "bin/repository reparse", continue on "PhabricatorWorkerPermanentF…
Jun 18, 2019
1dd62f7
Fix more "msort()" vs "msortv()" callsites
Jun 18, 2019
6219d30
Recommend dumping database backups with "--compress --output X" inste…
Jun 5, 2019
7538286
Fix missing link targets for "View Object" header buttons in HTML email
Jun 18, 2019
dda5c13
Parse "shallow" frames in the Git "upload-pack" wire protocol parser
Jun 13, 2019
dcf3ca8
When a user clicks a navigation link in a dialog, close the dialog
Jun 6, 2019
5d8ee50
Replace weird, redundant list of branches in Diffusion "Manage" UI wi…
Jun 17, 2019
9f44ee3
Use "link.getAttribute('href')", not "link.href", to bypass dark brow…
Jun 19, 2019
caaa139
Don't count "Cc: x@y.com" as a legitimate recipient if the user who h…
Jun 19, 2019
37e26f1
Improve rendering of "default value changed" custom form transactions…
Jun 19, 2019
53f8ad1
Fix an issue in Owners where a transaction change could show too many…
Jun 20, 2019
c0dc411
Update "phabricator/" for "topological" API changes
Jun 20, 2019
6b9f4a9
Modularize PhabricatorEditEngineConfigurationTransaction
phacility-bot Jun 19, 2019
ca56e85
Don't handle JIRA/Asana URIs with anchors or query parameters in a sp…
Jun 19, 2019
75c3598
Require commit identities when editing commits to resolve an issue wi…
Jun 24, 2019
d98bf8e
Drive "phd stop" entirely from the process list, not PID files on disk
Jun 20, 2019
b99c240
Deprecate "bin/phd ... --gently" and update documentation
Jun 20, 2019
08b9e70
Make "bin/phd status" report local daemons from the process list, not…
Jun 20, 2019
2498e37
Make "phd start" and "phd reload" use the process list, not PID files
Jun 20, 2019
65bc481
Remove "phd.pid-directory" configuration and stop passing "piddir" to…
Jun 20, 2019
a3397fb
Consider "all account members are disabled" to be a permanent failure…
Jun 24, 2019
da0dfc0
Make "bin/files" parsing of working set arguments more consistent
Jun 24, 2019
eaa6033
Limit the read buffer size in `bin/storage dump`
Jun 25, 2019
987e104
Bump the remarkup cache version after JIRA/Asana rule changes
Jun 25, 2019
159fd44
Correct transaction strengths after inconsitent scaling by 100 vs 1000
Jun 26, 2019
d6dc5d8
Fix the "x" link in tokenizer tokens incorrectly closing dialogs
Jun 28, 2019
0e2cb6e
Fix missing URI for "OAuthServerClient" object handles, causing dialo…
Jun 29, 2019
d22f6d2
Lightly modernize OAuth server application view pages
Jun 29, 2019
df29b82
Remove unused property "slug" from Workboard View controller
Jun 29, 2019
0ae9e2c
Remove property "id" from Workboard View controller
Jun 29, 2019
9c190d6
Separate workboard view state (ordering, filtering, hidden columns) f…
Jun 29, 2019
9e096cd
Give the workboard "default" workflows more modern state handling
Jun 29, 2019
577020a
Move workboard "filter" workflow to a separate controller
Jun 30, 2019
9ea7227
Move workboard "View as Query" workflow to a separate controller
Jul 2, 2019
ec352b1
Move workboard "Bulk Edit Tasks" workflow to a separate controller
Jul 2, 2019
24b466c
Move workboard "Move Tasks to Column..." workflow to a separate contr…
Jul 2, 2019
58e2fa0
Differentiate between "Move Tasks to Column..." and "Move Tasks to Pr…
Jul 2, 2019
2de8a23
Remove remnants of clumsy old URI state handling from workboards
Jul 2, 2019
fc79599
Remove obsolete "options" from workboard "updateCard()" call
Jul 2, 2019
02315c4
Fix double-close on dialogs leading to Javascript console error
Jul 3, 2019
45f4211
Fix URI escaping, which should actually be "%s", not "%p"
Jul 4, 2019
3c43222
Fix paging fatal with flagged objects
phacility-bot Jul 4, 2019
2c43543
Start fleshing out PhabricatorAuthProviderViewController
phacility-bot Jul 10, 2019
0999193
Fix "add more metadata" fatal in Pholio
Jul 11, 2019
41ea204
Update one straggling "CAN_INTERACT" check in comment removal
Jul 11, 2019
d2935fd
Fix a bad call to "writeInfo()" in "bin/phd stop" with no PHABRICATOR…
Jul 12, 2019
7852adb
Actually enforce auth.lock-config
phacility-bot Jul 9, 2019
2f313a0
Remove "unstable" status and T2784-specific warning message
phacility-bot Jul 15, 2019
97c1699
Fix transaction title rendering for AuthenticationConfigs
phacility-bot Jul 17, 2019
db69686
Make pressing "R" on your keyboard reload the card state on workboards
Jul 2, 2019
1ee6ecf
Move "BoardResponseEngine" toward a more comprehensive update model
Jul 17, 2019
8669c3c
When updating a workboard with "R", send the client visible set with …
Jul 3, 2019
d02beaf
Make reloading workboards with "R" respect workboard ordering
Jul 17, 2019
9ab5f59
Export "date" and "remarkup" custom fields to Excel + "zip" extension…
Jul 17, 2019
17caecd
Make workboard real-time updates mostly work
Jul 17, 2019
cb4add3
In Ferret, allow documents with no title to match query terms by usin…
Jul 18, 2019
f55aac4
Rename "pastebin" database to "paste"
Jul 18, 2019
5dd4895
Move "Password Reset" email to "PeopleMailEngine"
Jul 19, 2019
a0c9f9f
Allow installs to customize mail body guidance in the "Email Login" a…
Jul 19, 2019
38d30af
Give "Auth Messages" a view/detail state before users customize them
Jul 19, 2019
ced416c
Allow Auth messages to have detailed descriptions and default values,…
Jul 19, 2019
80294e7
Add a rate limit to generating new account recovery links for a given…
Jul 19, 2019
e090b32
Add a rate limit to requesting account recovery links from a given re…
Jul 19, 2019
a75766c
Replace old rate limiting in password login flow with "SystemAction" …
Jul 19, 2019
2ee5e71
Simplify implementation of "SysetemAction->getSystemActionConstant()"
Jul 19, 2019
4fd473e
Remove explicit administrative actions from the user activity log
Jul 19, 2019
cd44925
Allow users with no CAN_EDIT permissions to silence projects if they …
Jul 22, 2019
6831ed9
Contain fallout from overheating feed queries on user profile pages
Jul 23, 2019
32dd13d
Modularize user activity log message types
Jul 19, 2019
57799bc
Give user log types a tokenizer and datasource instead of a page of c…
Jul 19, 2019
60db658
Record account recovery email links in the user activity log and make…
Jul 19, 2019
99c864f
Provide a basic detail view for user activity logs
Jul 19, 2019
f6621a5
Tailor "Restart All Builds" for the complex realities of modern build…
Jul 24, 2019
7e09da3
Fix policy behavior of "slowvote.info" API method
Jul 30, 2019
7d41535
When a task card is edited, emit update events for old boards and par…
Jul 24, 2019
d81d0c3
Fix an issue where editing cards on a workboard with implicit column …
Jul 24, 2019
0b0ab1b
Add a "slowvote.poll.search" API method
Jul 31, 2019
f92480f
Fix two minor display issues with the Conduit "*.search" API document…
Jul 31, 2019
2ec39af
Deprecate ancient "slowvote.info" API method
Jul 31, 2019
47d497a
When users visit a Phame post URI with an old blog ID, canonicalize t…
Jul 31, 2019
76cd181
Don't try to emit project board update events if there are no project…
Jul 31, 2019
8e263a2
Support "date" custom fields in "*.edit" endpoints
Jul 31, 2019
b81c838
Document support for "limit" in tokenizer-based Custom Fields
Jul 31, 2019
f5c380b
Add very basic support for generating PDF documents
Aug 1, 2019
3069ef4
Prevent object titles in the "Object Attacher" dialog from triggering…
Aug 1, 2019
1fe6311
Modernize user and repository "delete" workflows and improve document…
Aug 2, 2019
6c41508
Fix an issue where lines with more than one pattern match highlighted…
Aug 2, 2019
87f878e
Stop trying to CC merchants on invoices/receipts
Aug 2, 2019
31254c5
Correct column options presented in "Move tasks to project..." on wor…
Aug 7, 2019
6deac35
Don't show proxy (subproject/milestone) columns as options in "Move t…
Aug 7, 2019
0561043
In "Move task to..." workflow, separate visible and hidden columns in…
Aug 7, 2019
937edcd
Fix a warning in BoardLayoutEngine when no objects are being updated
Aug 7, 2019
46d9065
Drop test for awardable badges on "Badges" tab of user profiles to av…
Aug 8, 2019
9bd74df
Autofocus the "App Code" input on the TOTP prompt during MFA gates af…
Aug 8, 2019
0a3c269
When the feed query on project profile pages overheats, contain the d…
Aug 8, 2019
c092492
Fix missing display cell in daemon summary table
Aug 12, 2019
006cb65
Make the success message from "bin/config" more clear
Aug 12, 2019
82cf97a
When many commits are discovered at once, import them at lower priority
Aug 12, 2019
d890c03
Namespace all column references in ProjectQuery to fix ambiguity with…
Aug 15, 2019
803eb29
Fix flag typo in "Managing Caches" documentation
Aug 20, 2019
721a864
Implement "drydock.resource.search"
Aug 20, 2019
fc34554
Replace "bin/people profileimage" with "bin/user enable|empower"
Aug 20, 2019
64b399d
Remove "bin/accountadmin" and "scripts/user/add_user.php"
Aug 21, 2019
c439931
Respect "disabled" custom field status granted by "subtype" configura…
Aug 22, 2019
5741514
When a client submits an overlong "sourcePath", truncate it and continue
Aug 22, 2019
f1b054a
Correct the interaction between overheating and offset-based paging
Aug 22, 2019
109d7dc
Convert "Empower" from state-based MFA to one-shot MFA
Aug 22, 2019
353155a
Add "modifiedStart" and "modifiedEnd" constraints to "differential.re…
Aug 22, 2019
ecbc82d
Expose "commits.add|set|remove" on "maniphest.edit" API calls
Aug 22, 2019
719a7d8
Refactor the Phortune account detail page into a series of smaller, m…
Aug 2, 2019
e3ba530
Add scaffolding for ad-hoc email addresses associated with Phortune a…
Aug 2, 2019
277bce5
In Phortune, write relationships between payment accounts and merchan…
Aug 15, 2019
a3213ab
In Phortune, use actual merchant authority (not authority grants) to …
Aug 15, 2019
0cc7e8e
Update Phortune payment account interfaces to handle merchant vs cust…
Aug 16, 2019
c4e0ac4
Update PhortunePaymentMethod for modern policy interfaces
Aug 16, 2019
2016348
Make Phortune payment methods transaction-oriented and always support…
Aug 16, 2019
26ec924
When a page throws an exception and response construction throws anot…
Aug 16, 2019
a542024
Update Phortune subscriptions for modern infrastructure
Aug 16, 2019
c93ac91
Update Charge and Cart policies in Phortune, and make URIs more consi…
Aug 22, 2019
9bcd683
Update Phortune Merchant UI to bring it in line with Account UI
Aug 22, 2019
b3f8045
Make minor flavor updates
Aug 23, 2019
a39a37f
Update the Phortune cart/invoice workflow for policy changes
Aug 23, 2019
8f6a1ab
Roughly support external/email user views of Phortune recipts and inv…
Aug 23, 2019
4e13551
Add credential rotation and statuses (disabled, unsubscribed) to Phor…
Aug 23, 2019
a0a3879
In Phortune, send order email to account external addresses
Aug 23, 2019
97a4a59
Give the Phortune external portal an order view
Aug 24, 2019
7198bd7
When "utf8mb4" is available, use it as the default client charset whe…
Aug 27, 2019
0943561
Fix incorrect construction of subtype map when validating "subtype" t…
Aug 27, 2019
c664221
Straighten out replication/cache behavior in "bin/storage dump"
Aug 28, 2019
3c26e38
Provide a simple read-only maintenance mode for repositories
Aug 29, 2019
533a553
Remove the "grant authority" mechanism from users
Aug 30, 2019
b2b1748
Clean up two straggling UI issues in Phortune
Aug 31, 2019
9316cbf
Move web application classes into "phabricator/"
Sep 2, 2019
b6420e0
Allow repository service lookups to return an ordered list of service…
Sep 3, 2019
95fb237
On Git cluster read failure, retry safe requests
Sep 3, 2019
ff3d176
Instead of retrying safe reads 3 times, retry each eligible service once
Sep 3, 2019
8ff3a13
Generalize repository proxy retry logic to writes
Sep 3, 2019
d9badba
Give "bin/config" a friendlier error message if "local.json" is not w…
Sep 3, 2019
f8eec38
When "mysqli->real_connect()" fails without setting an error code, re…
Sep 3, 2019
e0d6994
Use the "@" operator to silence connection retry messages if initiali…
Sep 3, 2019
22b075d
Fix "ONLY_FULL_GROUP_BY" issue in SystemAction queries
Sep 3, 2019
f7290bb
Update a straggling "getAuthorities()" call in Fund
Sep 4, 2019
764db48
Make "bin/storage destroy" target individual hosts in database cluste…
Sep 4, 2019
adc2002
Make it easier to parse "X-Forwarded-For" with one or more load balan…
Sep 5, 2019
7e2bec9
Add a global setting for controlling the default main menu search scope
Sep 6, 2019
318e8eb
Allow bin/config to create config file
avivey Sep 8, 2019
caccbb6
When users try to log out with no providers configured, warn them of …
Sep 8, 2019
f16365e
Weaken the guidance recommending that installs enable "STRICT_ALL_TAB…
Sep 8, 2019
535c8e6
Remove the "ONLY_FULL_GROUP_BY" SQL mode setup warning and change the…
Sep 8, 2019
63c7302
Fix global search scope fatal on 404 page (or other pages with no App…
Sep 9, 2019
2780929
Don't offer personal saved queries in global "Search Scope" settings …
Sep 9, 2019
aaaea57
Fix fatal during redirection safety check for searching for Phabricat…
Sep 9, 2019
d965d9a
Index Herald fields, not just actions, when identifying objects relat…
Sep 9, 2019
4547714
Add a "Remove flag" action to Herald
Sep 9, 2019
7593a26
When Herald changes object subscribers, always hide the feed story
Sep 9, 2019
1d1a60f
Improve rendering of Herald rules in "Another Herald rule..." field
Sep 9, 2019
d2e1c41
When a project has a custom icon, use that icon to label the project …
Sep 9, 2019
a0ade50
Remove "Moved Document from ..." notice in Phriction
Sep 12, 2019
a35d7c3
Update rendering of policy edit transactions in Applications
Sep 12, 2019
9c6969e
Remove "Editable By" description fields in Passphrase, Phame, and Spaces
Sep 12, 2019
c9b0d10
Remove unused "icon" parameter from policy name rendering
Sep 12, 2019
506f93b
Give policy name rendering explicit "text name", "capability link", a…
Sep 12, 2019
9a36e69
Inline custom policy rules inside policy capability explanation dialogs
Sep 12, 2019
0c7ea8c
When users fail a "CAN_SEE" check, give them an "opaque" policy expla…
Sep 12, 2019
4f845d8
When users encounter a policy exception for a non-view capability wit…
Sep 12, 2019
d60d4e6
Don't present users with Herald fields/actions for uninstalled applic…
Sep 12, 2019
3e60128
Support "Subtype" in Herald
Sep 12, 2019
41f0b8b
Allow subtypes to specify "mutations", to control the behavior of the…
Sep 12, 2019
3f66203
Fix a straggling callsite to "renderApplicationPolicy()"
Sep 12, 2019
3dcb4a7
Work around rendering engine freeze in Chrome 77 affecting workboards
Sep 13, 2019
c5a4dea
Fix a typo in preamble X-Forwarded-For psuedocode
Sep 15, 2019
f529abf
In stacked area charts, group nearby points so they don't overlap
May 9, 2019
769e745
In charts, make "min" and "max" into pure functions and formally mark…
Sep 16, 2019
080e132
Track chart datapoints from their sources and provide a tabular view …
Sep 16, 2019
d4ed5d0
Make various UX improvements to charts so they're closer to making vi…
Sep 17, 2019
c06dd48
Support explicit stacking configuration in stacked area charts
Sep 17, 2019
16de915
Give "Burndown" charts a more straightforward definition and move all…
Sep 17, 2019
09d86c2
Unprototype "Facts" to clear Maniphest/chart fatals
Sep 23, 2019
be2a0f8
Fix a cursor paging issue in Conduit call logs
Sep 24, 2019
74d6bcb
Allow a user to target "#anchor" by navigating to any prefix
Sep 18, 2019
bff72ce
Generate more friendly anchor names for header sections in Remarkup
Sep 18, 2019
b1d4d5c
Add an "{anchor #xyz}" rule to Remarkup
Sep 24, 2019
058b7ae
Update "Change Username" instructions to be less foreboding
Sep 24, 2019
0c33145
When non-administrators click "Change Username", explain why they can…
Sep 24, 2019
6af776f
Allow installs to provide "Request a Username Change" instructions
Sep 24, 2019
06edcf2
Fix an issue where ancestors of permanent refs might not be published…
Sep 24, 2019
a73f592
Allow DocumentEngine to elect into diff construction
Sep 23, 2019
bb71ef6
Render image diffs as abstract blocks diffs via DocumentEngine
Sep 23, 2019
7ae711e
Add a "View as..." option to diff dropdowns for selecting between doc…
Sep 25, 2019
1c4450d
Allow the Jupyter engine to elect to emit diffs, and emit Jupyter doc…
Sep 25, 2019
a09b298
Correct DOM node metadata to let inline comments work against block-b…
Sep 25, 2019
932d829
Improve behavior of inline comment highlight reticle for block diffs
Sep 25, 2019
281598d
Use a hash-and-diff strategy to produce a diff layout for block-based…
Sep 25, 2019
9d884f1
Add "PhutilProseDiff" classes to "phabricator/"
Sep 25, 2019
884cd74
In prose diffs, use hash-and-diff for coarse "level 0" diffing to sca…
Sep 25, 2019
2c06815
When rendering Jupyter notebook diffs, split code inputs into individ…
Sep 26, 2019
7a0090f
Fix an issue where the "viewer" is not passed to Bulk Edit controls p…
Sep 26, 2019
f004b76
Add a "Subtype" tag to the task graph view in Maniphest
Sep 27, 2019
9944b66
Make HTTP/403 say "Yikes!"
Sep 28, 2019
a7f3316
Improve sequencing of various content/header checks in abstract block…
Sep 27, 2019
5afdc62
Make basic Juypter notebook rendering improvements and roughly suppor…
Sep 27, 2019
d9515e8
Perform basic block interdiffs when diffing abstract blocks, and inte…
Sep 27, 2019
76d9912
Force unified abstract block diffs into roughly usable shape
Sep 30, 2019
9f7aaa8
Fix an issue where any diff which could possibly be rendered as Jupyt…
Oct 2, 2019
344a2e3
In Jupyter notebooks, apply intraline diffing to source code lines
Oct 2, 2019
960c447
Support more than 9 portals
Oct 2, 2019
6d74736
When a large number of commits need to be marked as published, issue …
Oct 2, 2019
7badec2
Use "git log ... --stdin" instead of "git log ... --not ..." to avoid…
Oct 2, 2019
5dafabd
Fix deprecated argument order for "implode()"
Oct 17, 2019
d34dfa3
Fix an error message when calling "transaction.search" with a non-tra…
Oct 17, 2019
f497b93
Fix a fatal in the "Projects" curtain extension when a project edge c…
Oct 17, 2019
5b36f0c
Add default branch, description, and metrics (commit count, recent co…
Oct 24, 2019
633aa52
Persist login instructions onto flow-specific login pages (username/p…
Oct 25, 2019
3869457
Improve project member list behaviors related to disabled users
Oct 25, 2019
8ff0e3a
Support rich diff rendering with DocumentEngine for added/removed files
Oct 25, 2019
292f8fc
Fix an issue where added or removed source files could incorrectly se…
Oct 26, 2019
5d8457a
In the repository URI index, store Phabricator's own URIs as tokens
Oct 28, 2019
02f85f0
Remove the "ssh-auth-key" script
Sep 13, 2019
24f771c
Add an optional "--sshd-key" argument to "bin/ssh-auth" for reading "…
Sep 13, 2019
4a53fc3
Don't use "phutil_hashes_are_identical()" to compare public keys
Oct 29, 2019
e1da1d8
Trim and URI encode symbol names before building URIs from them
Oct 29, 2019
114166d
Roughly implement "harbormaster.artifact.search"
Oct 29, 2019
9d8cdce
Make the top-level burndown chart in "Maniphest > Reports" show open …
Oct 29, 2019
bcf15ab
Return empty data if fact dimension is missing, not yet available
Oct 21, 2019
97bed35
Show repository information (and use repository identities) in commit…
Oct 31, 2019
b0d9f89
Remove "State Icons" from handles
Oct 31, 2019
7bdfe5b
Show commits and revisions on tasks in a tabular view instead of hand…
Oct 31, 2019
c48f300
Add support for rendering section dividers in tables; use section div…
Oct 31, 2019
e46e383
Clean up "Revisions/Commits" table in Maniphest slightly
Oct 31, 2019
be2b8f4
Support querying projects by "Root Projects" in the UI, and "min/max …
Oct 31, 2019
6bada7d
Change the Herald "do not include [any of]" condition label to "inclu…
Nov 6, 2019
f5f2a0b
Allow username changes which modify letter case to go through as valid
Nov 6, 2019
9dbde24
Manually prune Git working copy refs instead of using "--prune", to i…
Nov 7, 2019
8dd57a1
When fetching Git repositories, pass "--no-tags" to make explicit "Fe…
Nov 7, 2019
1b40f7e
Always initialize Git repositories with "git init", never with "git c…
Nov 8, 2019
502ca47
When "Fetch Refs" are configured for a repository, highlight the "Bra…
Nov 8, 2019
d4491dd
Fix an issue with 1up diff block rendering for added or removed blocks
Nov 8, 2019
338b4cb
Prevent workboard cards from being grabbed by the "Txxx" object name …
Nov 8, 2019
2223d6b
Update Asana Auth adapter for "gid" API changes
Nov 8, 2019
cd60a8a
Update various Asana odds-and-ends for "gid" API changes
Nov 8, 2019
b83b322
Add an "Advanced/Developer..." action item for viewing object handle …
Nov 1, 2019
a3f4cbd
Correct rendering of workboard column move stories when a single tran…
Nov 9, 2019
72f82ab
Improve recovery from panel action rendering exceptions, and mark "Ch…
Nov 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Drive "phd stop" entirely from the process list, not PID files on disk
Summary:
Ref T13321. Depends on D20600. Make `bin/phd stop` mean:

  - `bin/phd stop`: Stop all processes which have daemon process titles. If we're instanced, only stop daemons for the current instance.
  - `bin/phd stop --force`: Stop all processes which have deamon process titles for any instance.

We no longer read or care about PID files on disk, and this moves us away from PID files.

This makes unusual flag `--gently` do nothing. A followup will update the documentation and flags to reflect actual usage/behavior.

This also removes the ability to stop specific PIDs. This was somewhat useful long, long ago when you might explicitly run different copies of the `PullLocal` daemon with flags to control which repositories they updated, but with the advent of clustering it's no longer valid to run custom daemon loadouts.

Test Plan: Ran `bin/phd start`, then `bin/phd stop`. Saw instance daemons stop. Ran `bin/phd stop --force`, saw all daemons stop.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13321

Differential Revision: https://secure.phabricator.com/D20601
  • Loading branch information
epriestley committed Jun 24, 2019
commit d98bf8ef8ee68e34ba2d74173a7be00f3153567f
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ protected function didConstruct() {

public function execute(PhutilArgumentParser $args) {
$err = $this->executeStopCommand(
array(),
array(
'graceful' => $args->getArg('graceful'),
'force' => $args->getArg('force'),
Original file line number Diff line number Diff line change
@@ -42,7 +42,6 @@ protected function didConstruct() {

public function execute(PhutilArgumentParser $args) {
return $this->executeStopCommand(
$args->getArg('pids'),
array(
'graceful' => $args->getArg('graceful'),
'force' => $args->getArg('force'),
Original file line number Diff line number Diff line change
@@ -386,78 +386,86 @@ final protected function executeStartCommand(array $options) {
return 0;
}

final protected function executeStopCommand(
array $pids,
array $options) {

$console = PhutilConsole::getConsole();

final protected function executeStopCommand(array $options) {
$grace_period = idx($options, 'graceful', 15);
$force = idx($options, 'force');
$gently = idx($options, 'gently');

if ($gently && $force) {
throw new PhutilArgumentUsageException(
pht(
'You can not specify conflicting options %s and %s together.',
'--gently',
'--force'));
$query = id(new PhutilProcessQuery())
->withIsOverseer(true);

$instance = PhabricatorEnv::getEnvConfig('cluster.instance');
if ($instance !== null && !$force) {
$query->withInstances(array($instance));
}

$daemons = $this->loadRunningDaemons();
if (!$daemons) {
$survivors = array();
if (!$pids && !$gently) {
$survivors = $this->processRogueDaemons(
$grace_period,
$warn = true,
$force);
}
if (!$survivors) {
$console->writeErr(
"%s\n",
pht('There are no running Phabricator daemons.'));
}
return 0;
try {
$process_refs = $query->execute();
} catch (Exception $ex) {
// See T13321. If this fails for some reason, just continue for now so
// that daemon management still works. In the long run, we don't expect
// this to fail, but I don't want to break this workflow while we iron
// bugs out.

// See T12827. Particularly, this is likely to fail on Solaris.

phlog($ex);

$process_refs = array();
}

$stop_pids = $this->selectDaemonPIDs($daemons, $pids);
if (!$process_refs) {
if ($instance !== null && !$force) {
$this->logInfo(
pht('NO DAEMONS'),
pht(
'There are no running daemons for the current instance ("%s"). '.
'Use "--force" to stop daemons for all instances.',
$instance));
} else {
$this->logInfo(
pht('NO DAEMONS'),
pht('There are no running daemons.'));
}

if (!$stop_pids) {
$console->writeErr("%s\n", pht('No daemons to kill.'));
return 0;
}

$survivors = $this->sendStopSignals($stop_pids, $grace_period);
$process_refs = mpull($process_refs, null, 'getPID');

// Try to clean up PID files for daemons we killed.
$remove = array();
foreach ($daemons as $daemon) {
$pid = $daemon->getPID();
if (empty($stop_pids[$pid])) {
// We did not try to stop this overseer.
continue;
}
$stop_pids = array_keys($process_refs);
$live_pids = $this->sendStopSignals($stop_pids, $grace_period);

if (isset($survivors[$pid])) {
// We weren't able to stop this overseer.
continue;
}
$stop_pids = array_fuse($stop_pids);
$live_pids = array_fuse($live_pids);

if (!$daemon->getPIDFile()) {
// We don't know where the PID file is.
continue;
}
$dead_pids = array_diff_key($stop_pids, $live_pids);

$remove[] = $daemon->getPIDFile();
foreach ($dead_pids as $dead_pid) {
$dead_ref = $process_refs[$dead_pid];
$this->logOkay(
pht('STOP'),
pht(
'Stopped PID %d ("%s")',
$dead_pid,
$dead_ref->getCommand()));
}

foreach (array_unique($remove) as $remove_file) {
Filesystem::remove($remove_file);
foreach ($live_pids as $live_pid) {
$live_ref = $process_refs[$live_pid];
$this->logFail(
pht('SURVIVED'),
pht(
'Unable to stop PID %d ("%s").',
$live_pid,
$live_ref->getCommand()));
}

if (!$gently) {
$this->processRogueDaemons($grace_period, !$pids, $force);
if ($live_pids) {
$this->logWarn(
pht('SURVIVORS'),
pht(
'Unable to stop all daemon processes. You may need to run this '.
'command as root with "sudo".'));
}

return 0;
@@ -492,42 +500,6 @@ final protected function executeReloadCommand(array $pids) {
return 0;
}

private function processRogueDaemons($grace_period, $warn, $force_stop) {
$console = PhutilConsole::getConsole();

$rogue_daemons = PhutilDaemonOverseer::findRunningDaemons();
if ($rogue_daemons) {
if ($force_stop) {
$rogue_pids = ipull($rogue_daemons, 'pid');
$survivors = $this->sendStopSignals($rogue_pids, $grace_period);
if ($survivors) {
$console->writeErr(
"%s\n",
pht(
'Unable to stop processes running without PID files. '.
'Try running this command again with sudo.'));
}
} else if ($warn) {
$console->writeErr("%s\n", $this->getForceStopHint($rogue_daemons));
}
}

return $rogue_daemons;
}

private function getForceStopHint($rogue_daemons) {
$debug_output = '';
foreach ($rogue_daemons as $rogue) {
$debug_output .= $rogue['pid'].' '.$rogue['command']."\n";
}
return pht(
"There are processes running that look like Phabricator daemons but ".
"have no corresponding PID files:\n\n%s\n\n".
"Stop these processes by re-running this command with the %s parameter.",
$debug_output,
'--force');
}

private function sendStopSignals($pids, $grace_period) {
// If we're doing a graceful shutdown, try SIGINT first.
if ($grace_period) {