Skip to content

Commit

Permalink
Sidecar zombie hotfix (#463)
Browse files Browse the repository at this point in the history
* process exit hotfix for sidecar unhandled rejection and uncaught exception

* updated changelog

* version v.1.6.2
  • Loading branch information
rafapaezbas authored Nov 25, 2024
1 parent acff10e commit bddb2c0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Pear Runtime Changelog

## v1.6.2

### Fixes

* Internal - Fix process termination after unhandled error in sidecar

## v1.6.1

### Fixes

* Linux - Updated sodium-native to version 4.3.1

## v1.6.0

### Features
Expand Down
7 changes: 6 additions & 1 deletion lib/crasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { isBare, platform, arch } = require('which-runtime')
const fs = isBare ? require('bare-fs') : require('fs')
const path = isBare ? require('bare-path') : require('path')
const checkout = require('../checkout')
const os = isBare ? require('bare-os') : require('os')

let hasLogged = false
const start = Date.now()
Expand All @@ -25,7 +26,11 @@ function logCrashAndExit (logPath, errorInfo, checkout, stackTrace, err) {

console.error(`Error logged at ${logPath}`)

runContext.exit(1)
if (isBare) {
os.kill(pid)
} else {
runContext.exit(1)
}
}

function setupCrashHandlers (processName, swap) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pear",
"version": "1.6.1",
"version": "1.6.2",
"main": "./boot.js",
"private": true,
"scripts": {
Expand Down

0 comments on commit bddb2c0

Please sign in to comment.