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

Enable mono runtime to handle SIGTERM like CoreCLR #82806

Closed
wants to merge 1 commit into from

Conversation

nealef
Copy link
Contributor

@nealef nealef commented Mar 1, 2023

Provide fix for #81093 - "Mono does not emit ProcessExit event on SIGTERM"

* src/mono/mono/mini/mini-posix.c
  - Add signal handler for SIGTERM
  - SIGTERM handler will set a global variable that may be monitored by the GC finalizer thread

* src/mono/mono/metadata/gc.c
  - Monitor for sigterm and kick off the shutdown process when encountered by calling mono_runtime_try_shutdown().
  - Exit with either the user set exitcode (System.Environment.ExitCode) or SIGTERM + 128.

"Mono does not emit ProcessExit event on SIGTERM"

	* src/mono/mono/mini/mini-posix.c
	  - Add signal handler for SIGTERM
	  - SIGTERM handler will set a global variable that may be
	    monitored by the GC finalizer thread

	* src/mono/mono/metadata/gc.c
	  - Monitor for sigterm and kick off the shutdown process when
	    encountered by calling mono_runtime_try_shutdown().
	  - Exit with either the user set exitcode
	    (System.Environment.ExitCode) or SIGTERM + 128.
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Mar 1, 2023
@nealef
Copy link
Contributor Author

nealef commented Mar 1, 2023

I assume I will need to add the same processing that's in mini-posix.c to mini-windows.c. I don't have that environment to test which is why I have hung off to see how the *IX builds went.

@nealef
Copy link
Contributor Author

nealef commented Mar 1, 2023

Closing so I can open a new PR that will provide a windows + posix solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM-meta-mono community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant