You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use Process.exec on Unix systems to replace the current process.
This doesn't work on Windows (crystal-lang/crystal#14422), so we use Process.run instead, plus exit(Process::Status) on Crystal 1.19 (crystal-lang/crystal#16436) or a fallback (exit status.system_exit_status.to_i32!) on older versions.
We're stopping execution of the current program with exec directly after emitting the last log message. Because of that, the async log dispatcher doesn't run anymore and the message never gets written.
For now I'm adding a patch to explicitly close the log backend, which flushes all pending message.
But this seems like a general problem that should be addressed in the Crystal repo.
This is ready for another review. We're using Process.exec on Unix systems and Process.run on Windows, plus exit(Process::Status) on Crystal 1.19 (crystal-lang/crystal#16436) or a fallback (exit status.system_exit_status.to_i32!) on older versions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use
Process.execon Unix systems to replace the current process.This doesn't work on Windows (crystal-lang/crystal#14422), so we use
Process.runinstead, plusexit(Process::Status)on Crystal 1.19 (crystal-lang/crystal#16436) or a fallback (exit status.system_exit_status.to_i32!) on older versions.Resolves #685