Skip to content

Allow monitor options in proc_lib:start_monitor/5 #9804

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Maria-12648430
Copy link
Contributor

Currently, the spawn options monitor and {monitor, MonitorOpts} are disallowed in the proc_lib:start* functions. This goes back all the way to R11, a ticket OTP-6345, and this post on the old Erlang ML.

For proc_lib:start_monitor, it makes no sense to forbid monitor options. Or at least, we don't see any benefit in doing so. On the contrary, it prevents "customizing" the monitor (eg custom tags, usage of the new priority option, etc). This PR removes this restriction.

For proc_lib:start and proc_lib:start_link, it would be possible to remove the restriction also, that is, without restoring the buggy behavior that seems to have given raise to OTP-6345.
However, in the presence of a monitor or {monitor, MonitorOpts} spawn option, the return value would change from Ret to {Ret, Mon}, with repercussions via gen into the start/start_link functions of the gen_* behaviors.
This may be ok, and require mostly work on the specs and documentation in the gen_* behaviors, aside from some adaptions in gen. The bigger question IMO is if and how supervisors should cope with this?


This PR also does a few more things than what is listed above, which are related to the new {link, LinkOpts} spawn option that appeared with the new priority messages. Those are mostly just documentation changes.

Copy link
Contributor

github-actions bot commented May 6, 2025

CT Test Results

    2 files     97 suites   1h 5m 55s ⏱️
2 207 tests 2 155 ✅ 52 💤 0 ❌
2 585 runs  2 529 ✅ 56 💤 0 ❌

Results for commit 6d9d85b.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@jhogberg jhogberg added the team:VM Assigned to OTP team VM label May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants