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

stdlib: Include process label in gen_statem, gen_server, gent_event, gen_fsm crash messages #8003

Conversation

tomas-abrahamsson
Copy link
Contributor

The #7720 added process labels and the proc_lib:set_label/1 and get_label/1 functions. This PR includes a process label printout in crash message printouts from gen_statems, gen_servers, gen_events and gen_fsms, to make it easier to identify the crashing process.

Below is an example of what it may look like for a gen_statem. The "Process label" on the second line is new.

  ** State machine <0.1386.0> terminating
  ** Process label = {some_label, ...}
  ** When server state  = #{...}
  ** Reason for termination = error:...
  ** Callback modules = [...]
  ** Callback mode = state_functions

If no label has been set, then that process label line will not be included, and the printout will look like it did before this commit.

For gen_statem processes, as well as gen_servers, gen_event and
gen_fsms, if they crash and a process label had been set with
proc_lib:set_label/1, then include that label in the printout,
to make it easier to identify the crashing process.

Below is an example of what it may look like for a gen_statem.
The "Process label" on the second line is new.

  ** State machine <0.1386.0> terminating
  ** Process label = {some_label, ...}
  ** When server state  = #{...}
  ** Reason for termination = error:...
  ** Callback modules = [...]
  ** Callback mode = state_functions

If no label has been set, then that process label line will not be
included, and the printout will look like it did before this commit.
Copy link
Contributor

github-actions bot commented Jan 5, 2024

CT Test Results

    2 files     92 suites   35m 53s ⏱️
2 009 tests 1 960 ✅ 48 💤 1 ❌
2 316 runs  2 265 ✅ 50 💤 1 ❌

For more details on these failures, see this check.

Results for commit 17183ba.

♻️ 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

@rickard-green rickard-green added the team:PS Assigned to OTP team PS label Jan 8, 2024
@RaimoNiskanen RaimoNiskanen added feature testing currently being tested, tag is used by OTP internal CI in progress priority:medium and removed testing currently being tested, tag is used by OTP internal CI labels Jan 10, 2024
@dgud dgud added testing currently being tested, tag is used by OTP internal CI and removed testing currently being tested, tag is used by OTP internal CI labels Jan 11, 2024
@dgud dgud self-requested a review January 11, 2024 14:38
Copy link
Contributor

@dgud dgud left a comment

Choose a reason for hiding this comment

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

Nice work, thanks.

@RaimoNiskanen RaimoNiskanen merged commit 5df78c3 into erlang:master Jan 16, 2024
@RaimoNiskanen
Copy link
Contributor

Great work! Thank you for your pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants