-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
[BUG] it crashed when tar a changing file #238
Comments
Well, it should raise an error and fail the archive process, but that error should be caught by the |
I think the bug here was already fixed. Using this script: const {spawn} = require('child_process')
const c = spawn('bash', ['-c', `
echo 'starting' > ./ou
for i in {1..10000} ; do
echo $i >> ./ou
echo 'going'
done
`])
c.stdout.once('data', () => {
const tar = require('./');
const file = './test.tar.gz'
const fileList = ['./ou']
try {
tar.create({
gzip: false,
file,
}, fileList)
.then(_ => console.log('done'))
.catch(err => console.log('CAUGHT', err))
} catch (err) {
console.log('THROWN', err)
}
}) I get the following output on 4.4.8
But on 4.4.13, I get this:
and on the latest master (v5.0.5) I get this:
Bisect says that the changed behavior started at this commit:
Moral of the story, upgrade to at least 4.4.12 (if not all the way to latest, v5.0.5), and always put a callback on your |
It works smoothly after I upgrade tar version to v5.0.5. Thanks for your quick response. |
node-tar will crash when tar a file which is changing rapidly.
Steps to Reproduce
Node will crashed and raise below error:
Expected Behavior
Anyway it should not crash node.
version info:
node v8.11.1
node-tar 4.4.8
The text was updated successfully, but these errors were encountered: