Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

ATL hangs on compiling #279

Closed
robbaman opened this issue Nov 22, 2016 · 9 comments
Closed

ATL hangs on compiling #279

robbaman opened this issue Nov 22, 2016 · 9 comments

Comments

@robbaman
Copy link

I've noticed that in about 50% of the cases when I start the webpack command using awesome-typescript-loader the command never finishes. I've spent some time going through the sources attempting to figure out what could be wrong (I'm sure it's something that's specific for my project) but haven't been able to figure it out.

It goes wrong in the communication between the child process and the main process in checker.ts and instance.ts

To illustrate I've added a log line to the req() function logging a send message, a log to the replyOk function in instance.ts and another in the receive-message event handler in checker.ts again.

Note how initially the EmitFile messages all pass the replyOk function in instance.ts and that every one also has a receive success log line, but after some time the replyOk lines seem to no longer be received by the checker.ts code.

Unfortunately I'm not much of a Node programmer, so I'm really not sure how to get additional logging out of the system, so I'd really appreciate some assistance with getting this resolved. As it stands now, I can't use webpack more than once or twice without it hanging. Using it in watch mode is definately out of the question as-is...

send Init 1
send EmitFile 2
send EmitFile 3
replyOk 1
receive 1 success
replyOk 2
receive 2 success
replyOk 3
receive 3 success
send EmitFile 4
replyOk 4
receive 4 success
send EmitFile 5
send EmitFile 6
send EmitFile 7
send EmitFile 8
send EmitFile 9
replyOk 5
replyOk 6
receive 5 success
receive 6 success
replyOk 7
replyOk 8
receive 7 success
receive 8 success
replyOk 9
send EmitFile 10
send EmitFile 11
send EmitFile 12
receive 9 success
replyOk 10
receive 10 success
replyOk 11
send EmitFile 13
receive 11 success
replyOk 12
replyOk 13
send EmitFile 14
send EmitFile 15
send EmitFile 16
send EmitFile 17
send EmitFile 18
send EmitFile 19
send EmitFile 20
receive 12 success
replyOk 14
receive 13 success
send EmitFile 21
send EmitFile 22
send EmitFile 23
receive 14 success
replyOk 15
replyOk 16
replyOk 17
receive 15 success
receive 16 success
replyOk 18
receive 17 success
replyOk 19
receive 18 success
receive 19 success
send EmitFile 24
send EmitFile 25
send EmitFile 26
send EmitFile 27
send EmitFile 28
send EmitFile 29
send EmitFile 30
send EmitFile 31
send EmitFile 32
send EmitFile 33
send EmitFile 34
send EmitFile 35
send EmitFile 36
send EmitFile 37
send EmitFile 38
send EmitFile 39
send EmitFile 40
replyOk 20
receive 20 success
replyOk 21
receive 21 success
replyOk 22
receive 22 success
replyOk 23
send EmitFile 41
receive 23 success
replyOk 24
replyOk 25
replyOk 26
receive 24 success
replyOk 27
receive 25 success
replyOk 28
receive 26 success
receive 27 success
send EmitFile 42
send EmitFile 43
send EmitFile 44
receive 28 success
send EmitFile 45
send EmitFile 46
send EmitFile 47
send EmitFile 48
send EmitFile 49
send EmitFile 50
send EmitFile 51
send EmitFile 52
send EmitFile 53
send EmitFile 54
send EmitFile 55
send EmitFile 56
replyOk 29
send EmitFile 57
replyOk 30
@s-panferov
Copy link
Owner

@robbaman do you have some example to reproduce?

@ocombe
Copy link

ocombe commented Nov 23, 2016

I have the same problem, I'm on windows so maybe this is the reason ?

@s-panferov s-panferov modified the milestone: 3.0 Nov 23, 2016
@robbaman
Copy link
Author

I'm also on Windows, I currently don't have a working solution to link because I don't think my employer will appreciate me sharing it :)

I'll try and find some time to create a working example with less sensitive code. This may take me some days though, so please bear with me.

Note that I used the 3.0.0 beta build by accident. Now that I've switched back to 2.2.1 everything works just fine (though the 3.0.0 build felt alot faster... when it didn't hang)

@jsgoupil
Copy link

Same thing here, I fell back to ts-loader and it worked just fine... I was using 3.0.0-beta.3

@s-panferov
Copy link
Owner

Seems to be related nodejs/node#7657

@s-panferov
Copy link
Owner

I stole some hacks to buffer IPC messages from the VSCode, should work now.

@mindlink
Copy link

mindlink commented Jan 3, 2017

We seem to be experiencing this only in certain projects in certain situations and not on all machines.

on a windows server 2008 R2 build this happens for us for one of our projects when running karma. So there's lots of moving parts here.

What we have found is that the buffering code isn't quite doing enough, while it reduces the chance of this happening, it can still happen under certain scenarios.

By wrapping the continuation of the send loop in a setImmediate we have resolved the issue for now... However, I have a feeling that it is a fundamental issue with some versions of node + windows + project.

@abobwhite
Copy link

I am seeing this on every file change with version 3.0.7....anything specific I'm missing? What node version? I have 6.10

@abobwhite
Copy link

Nevermind, it turns out my issue was related to this baldore/open-browser-webpack-plugin#18 .

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

No branches or pull requests

5 participants