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

process.title value is not respected on macOS (14.x.x+) #34280

Closed
coreybutler opened this issue Jul 9, 2020 · 9 comments
Closed

process.title value is not respected on macOS (14.x.x+) #34280

coreybutler opened this issue Jul 9, 2020 · 9 comments
Labels
macos Issues and PRs related to the macOS platform / OSX.

Comments

@coreybutler
Copy link
Member

  • Version: 14.0.0+
  • Platform: macOS
  • Subsystem: process

What steps will reproduce the bug?

process.title = "test"

How often does it reproduce? Is there a required condition?

This appears in all 14.x.x releases. It does not appear in 13.x.x (I tested with 13.5.0)

What is the expected behavior?

The process name should be test, which is typically reflected in the Activity Monitor on macOS.

What do you see instead?

The process name is always node

Additional information

This appears to be a regression of #28945.

@devsnek devsnek added the macos Issues and PRs related to the macOS platform / OSX. label Jul 9, 2020
@devsnek
Copy link
Member

devsnek commented Jul 9, 2020

The name is changed (you can verify with ps, top, htop, etc) but activity monitor won't show the change. If you want activity monitor to reflect the change you have to use internal apple api hackery (or shell out to lsappinfo)

@coreybutler
Copy link
Member Author

coreybutler commented Jul 9, 2020

@devsnek ah yes, I do see it with ps in 14.x.x.

It seems to me that the most common process display tools (like Activity Monitor) should either be supported in Node, or the documentation should have a note to help folks understand why it doesn't display, especially since there are differences between Node releases.

Just for reference, node-mac has pretty much "just worked" in Activity Monitor for several years using process.title=.... Only recently have I seen users submitting issues about not being able to find their process in tools like Activity Monitor. Point: something has obviously changed (again). That's fine as long as there is some reference to the change.

I can close this issue and open a documentation issue instead, if documentation is a better direction.

@bnoordhuis
Copy link
Member

Platform: macOS

Can you post the output of uname -a? It might be relevant.

FWIW, I'm fairly sure certain changes in libuv are responsible, probably libuv/libuv@6e3e422c. If that's the case it's trading a minor regression for a big one and this is the new status quo unless someone figures out a workaround.

@coreybutler
Copy link
Member Author

uname -a output:

Darwin iMac.local 19.5.0 Darwin Kernel Version 19.5.0: Thu Apr 30 18:25:59 PDT 2020; root:xnu-6153.121.1~7/RELEASE_X86_64 x86_64

@devsnek
Copy link
Member

devsnek commented Jul 9, 2020

fwiw i don't observe any version of node (10 through 14) changing the title in activity monitor.

@bnoordhuis
Copy link
Member

Libuv's Activity Monitor integration was last tested on macos 10.14. Apple has a habit of breaking the interface with every new release so it's quite possible that it no longer works.

I'm not planning to investigate and I'm reluctant to take patches because every change to that subsystem seems to cause regressions, just check out git log src/unix/darwin-proctitle.c.

@coreybutler
Copy link
Member Author

coreybutler commented Jul 10, 2020

Given the history and the unstable nature of Apple's releases, perhaps it's better to just document/cite this as a known behavior and move on. Thoughts?

@bnoordhuis
Copy link
Member

@coreybutler Sounds reasonable. Want to open a PR?

@coreybutler
Copy link
Member Author

Yeah, I can do that.

@Trott Trott closed this as completed in 84b35b2 Aug 4, 2020
codebytere pushed a commit that referenced this issue Aug 6, 2020
Many users assume the act of assigning a value to `process.title` will
update the name of their application in apps like macOS Activity Monitor
or Windows Services Manager. This has worked in the past, but fails in
some versions of Node.js. Ultimately developers are left confused,
especially when it works in one version of Node.js and not another.
Given the recurring nature and complexity of the underlying problem, it
does not seem like a resolvable problem. This note clarifies the source
of the problem, sets developer expectations.

Refs: #28945
PR-URL: #34557
Fixes: #34280
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
codebytere pushed a commit that referenced this issue Aug 11, 2020
Many users assume the act of assigning a value to `process.title` will
update the name of their application in apps like macOS Activity Monitor
or Windows Services Manager. This has worked in the past, but fails in
some versions of Node.js. Ultimately developers are left confused,
especially when it works in one version of Node.js and not another.
Given the recurring nature and complexity of the underlying problem, it
does not seem like a resolvable problem. This note clarifies the source
of the problem, sets developer expectations.

Refs: #28945
PR-URL: #34557
Fixes: #34280
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
addaleax pushed a commit that referenced this issue Sep 22, 2020
Many users assume the act of assigning a value to `process.title` will
update the name of their application in apps like macOS Activity Monitor
or Windows Services Manager. This has worked in the past, but fails in
some versions of Node.js. Ultimately developers are left confused,
especially when it works in one version of Node.js and not another.
Given the recurring nature and complexity of the underlying problem, it
does not seem like a resolvable problem. This note clarifies the source
of the problem, sets developer expectations.

Refs: #28945
PR-URL: #34557
Fixes: #34280
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
addaleax pushed a commit that referenced this issue Sep 22, 2020
Many users assume the act of assigning a value to `process.title` will
update the name of their application in apps like macOS Activity Monitor
or Windows Services Manager. This has worked in the past, but fails in
some versions of Node.js. Ultimately developers are left confused,
especially when it works in one version of Node.js and not another.
Given the recurring nature and complexity of the underlying problem, it
does not seem like a resolvable problem. This note clarifies the source
of the problem, sets developer expectations.

Refs: #28945
PR-URL: #34557
Fixes: #34280
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macos Issues and PRs related to the macOS platform / OSX.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants