-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Error: Another accept task is ongoing :: JS Native classes making HTTP dispatcher fail. #6616
Comments
I just Also this is a duplicate of #6301, but this the better issue as it has a more easily reproducible example and better environment information. |
I have made some progress investigating how to reproduce/ or what's causing the error. As the exception was showing something related to the HTTP dispatcher & an ongoing task, I put the HTTP dispatcher inside a setTimeout of 1ms. that solved the problem ** for now **. In this screenshot: https://prnt.sc/tbhv6k, you can see the changes I have made. I did this because my logic was indicating me that it was related to some internal process from Deno taking place so I guessed the I hope this provides more context as what I did is not an optimal solution nor fixes the bigger problem as it is likely this issue is affecting something else more than an http dispatcher |
I added some logging to check where's the problem:
CC @piscisaureus @ry |
It would be very helpful for debugging if we had a small repeatable snippet of code. For example, if someone made a copy of @andreespirela's code base, and slowly started removing bits of code that have nothing to do with repeating this bug, all the time ensuring that it still fails - this would get us 90% towards a fix to this bug. |
@ry I will try to do this on my side, although it has been hard because as I mentioned, I don’t find the right context since everything seems to be aleatory even though it’s not. But I will do my best effort to put some small piece of code together and reproduce this. Hopefully, I will get something. |
We've discussed this issue offline and have a candidate for the root cause of the problem. I'll be working on a fix. |
@andreespirela this issue should be fixed by #6838 - unfortunately due to unversioned imports I am not able to run provided branch on latest Deno. Would you mind updating it? |
Thank you!. I will be updating the branch throughout the day and will let you know. |
@andreespirela Is this issue fixed? |
@lucacasonato As far as I have tested, it is. It's been a pain to use the initial branch I mentioned on this ticket because of many changes I have made along with the upgrades from Deno, but with current branches and current versions of Mandarine this has not happened anymore. initially, I had a setTimeout as a quickfix for the HTTP dispatcher to work When the bug was happening, commenting out the setTimeout would cause Mandarine to fail while the modules were loaded, right now, I'm not using any setTimeout and Mandarine keeps working just fine |
I will close because it seems like it was fixed. |
This very strange bug has been haunting me for about six months... And it is still not fixed. It starts to appear very unpredictable! Today's working code may not start in a week! It is primarily related to import.
|
What's your environment? |
I tried it on minimal code, but the error can only appear when there is a lot of import perhaps it also has something to do with decorators. just like that
|
This is right, initially it happened to me with including a decorator in the code. Can you please provide a video or do a deeper investigation on when it happens, how it happens, take a look at the video I first attached, and see my first comment on this bug, let's see if you can reproduce something similar and see if we can get something out of it |
As I have noticed it depends primarily on the amount of import and export in the code. https://youtu.be/i1ZYFvHtiYg. |
I am having the same issue, and its almost identical to what @irustm showed in the video. I.e., Too many exports in my dep.ts file (i.e., my dependencies file) My environment is Win10, Deno 1.3.0 on E: drive, local install of postgresql on E: drive The hacky solution is to break your dependency files into smaller chunks. That seems to work for me so far. So now I have: dep_0.ts and split my exports between them. this works, but its obviously not expected behavior Prior to doing this, I just had one file called dep.ts which contained this:
See Last line ^ So to reiterate, this was my solution: (in my app.ts file)
|
I believe this is most likely caused by bug in TLA - tracked in #6616 |
As 1.5.0 was released today, after some testing, I can't manage to reproduce it. I don't know if this is because a fix as suggested by @bartlomieju or the possible nature of the bug. I'm highly on the side that it was fixed, but I can't feel certain. |
Let's close it then and consider it fixed. If it does pop up again at, we can reopen the issue. |
Note: This is a really strange bug, so I would like to ask you for patience while reading it.
[Details]
First, I would like you to see this video because it will be hard to explain with only words:
Click here to see video
I have attached this video in .ZIP format at the end of the issue if you do not feel comfortable with google drive
--
What you saw in this video is that a class with no imports whatsoever (I say this because at first I thought imports were making the HTTP dispatcher fail) is making the http dispatcher fail.
It's been happening to new classes on my code no matter whether it has imports or no as you saw in the video. I have spent more than a day to find the root of the problem in order to be able to record this video.
I can create any class in any folder, and it will make the http dispatcher fail, no matter what the content of the class is.
It is also happening to both static and non-static methods, it is also happening to classes without methods. so if I only import the class and as soon as I call it like this
MyClass;
(so no effect at all on the code), it will make the HTTP dispatcher fail.Update: It is happening not only with JS classes, but also empty defaults (
export default {}
) & functions (export function MyFunction() {}
), with any class name, with any method name...[Context]
It is impossible for me to provide a small context or reproducible context because I do not even know what the context is. It happens randomly to new classes, one class may cause the HTTP dispatcher fail, but another class may work just fine. When finding the causes and playing around with the code, I moved the class you saw in the video to a folder inside a folder inside a folder, and it worked fine, then I got the class out of the folder, and it started failing again: I say this just to demonstrate how random it is.
[Additional]
I have wiped out my DENO_DIR, but it didn't do anything, the error was still being thrown.
I didn't want to open this issue until being sure it was a real issue/bug. As per my conversation with @lucacasonato where I share these same details, we agreed on the weirdness of this.
[Stacktrace]
[Code details]
This is happening in Mandarine Framework. You can find the failing code in the branch
make-everything-a-proxy
.deno run --config tsconfig.json --allow-net --allow-read examples/example-1.ts
OrmCoreDecoratorsProxy
which is the class that is making the HTTP dispatcher fail at this time, is being called in/orm-core/core/decorators/entityDecorator.ts
Line 16. (Inside decorator method "Table")OrmCoreDecoratorsProxy
is located in/orm-core/proxys/ormCoreDecorators.ts
I would like to mention that the decorator
Table
where the problem is happening as described before is not even being called in the file that's being ran (examples/example-1.ts
), so the code is never processingOrmCoreDecoratorsProxy
, the very very simple fact of putting it in the code is making the HTTP dispatcher fail somehow.[OS]
MacOS Mojave 10.14.6
[Environment]
deno 1.1.2
v8 8.5.216
typescript 3.9.2
Update After testing with many versions of Deno, this started happening in version 1.0.3 as it is not happening in 1.0.2
cc @lucacasonato
screen-capture (3).webm.zip
The text was updated successfully, but these errors were encountered: