-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Sails request hangs on sails.getDataStore().transaction(fn) , and fn seems not executed when sails-mysql upgraded to 1.0.0-16 #4271
Comments
@guretno Thanks for posting, we'll take a look as soon as possible. For help with questions about Sails, click here. If you’re interested in hiring @sailsbot and her minions in Austin, click here. |
I'm also getting hanging request issues, but with Model.getDatastore().sendNativeQuery(). I'm using sails-mysql 1.0.0-16 as well. |
I confirm this issue
|
I can also confirm this issue. I'm using sails 1.0.0.0-45 and sails-mysql 1.0.0-16. |
Confirmed as well,:
|
This is a blocking issue at least for me, downgrading sails-mysql to 1.0.0-15 does not fix this problem. |
@moty66 try to remove node_modules, clear cache and etc.. 15v should fix. |
Yes, for us, downgrading sails-mysql to 1.0.0-15 helped to solve this issue. |
I also have the same issue with |
@guretno Just to clarify, in this example, it looks like you would expect a hung request if any error occurred, since the error isn't being handled in the final |
@mikermcneil Even if At least in my case (no transaction), the |
@mikermcneil Thanks for looking at this issue. Yep still the same, it seems the .exec() callback is not getting called. Does it have something to do with the upgrade of the driver machinepack-mysql in sails-mysql? I saw that the datastore and hence the transaction as well as send native query function are handled by that and it's being upgraded to v3.0.0 in sails-mysql 1.0.0.16 to solve a memory leak issue (#4264). Thanks a lot! |
thanks @sgress454 (https://github.com/sgress454/test-sails-issue-4271) -- looking into this |
@guretno yeah good call, quite possibly-- could also be the runner itself |
@guretno @sgress454 @fenichelar @itomas @smihaljenovic @moty66 @akraminakib @mokxter @TomislavStrugacevac Hey everyone, thanks for the help. I just published a release of sails-hook-orm (2.0.0-23) with a fix. To pick that up, run Here's what happened: First of all, this bug was particularly pernicious because Now for the actual bug: For compatibility, sails-hook-orm calls the driver directly rather than using the adapter within its implementation of the RDI methods-- that is, the datastore methods available in userland (sendNativeQuery(), transaction(), etc). But when I bumped the runner version in the mp-mysql driver, I didn't update the usage in sh-orm. That's fixed now. @guretno @sgress454 @fenichelar @itomas @smihaljenovic @moty66 @akraminakib @mokxter @TomislavStrugacevac I verified that this patch fixes the repro here, but when y'all have a moment, would you try that out and make sure everything looks good in your apps? |
Yo @mikermcneil In a strange twist, I find myself the first (I think) to google this issue and find your patch. I'm on sails 1.0.0-37, and sails-mysql 1.0.0-15 and grabbed sails-hook-orm 2.0.0-23 as you put above. Still getting no return from native query. (also tried replacing .exec( with .switch( and appropriate object for fun and no luck there either) How can I help you solve this problem? (which is also my problem now) Need some more package.json info? |
@mikermcneil , Yes it is fine now, the transaction callback is called. perfect, Thanks! I changed the sails-hook-orm to 2.0.0-23 and sails-mysql to 1.0.0-17. I see the machine also has been upgraded to machine@15.0.0-22.
@ultamatt , I guess you can try to remove the sails node_modules folder and try to |
@mikermcneil confirmed fix here as well. @ultamatt I second the |
I did nuked my node_modules and npm install'd as y'all suggested and now i'm right as rain. Thank you everyone! |
@mikermcneil :) |
Sails version: 1.0.0-37
Node version: 6.10.0 ,8.9.3
NPM version: 3.10.10, 5.5.1
DB adapter name: sails-mysql
DB adapter version: 1.0.0-16
Operating system: Linux (Amazon Linux AMI), MacOS 10.13.1
Hi, 5 days ago (on 23/12/17) suddenly I notice that my datastore transaction is not working and from the logs of my server, I saw that when there is a request, the processing hangs on sails.getDataStore().transaction(fn) and it seems the fn was not getting executed. I'm using sails v1.0 and I've tried in both node 6.10.0 LTS and 8.9.3 LTS and the issue persists.
Then later I found out that the sails-mysql is updated to 1.0.0-16 , 7 days ago (on 21/12/7) from sails-mysql git repo and since sails js framework setting on sails-mysql : ^1.0.0-14, hence it updated to 1.0.0-16 when i reinstall (npm install) and rebuild the package. The issue was not happening on sails-mysql 1.0.0-15.
How I'm using the data store transaction is as follows, (which I guess from the previous example from sails documentation),
Which I notice that the example on the implementation has been changed here https://next.sailsjs.com/documentation/reference/waterline-orm/datastores/transaction.
I tried to use 'await' but it always throws syntax error : Unexpected identifier. My current implementation is fine with sails-mysql version 1.0.0-15, so does the issue is because the way the transaction function need to be defined with async (if want to use v 1.0.0-16) like in the current example on sails documentation or my current implementation is fine but there are some steps i have missed here?
Thanks a lot in advance for any help/assistance provided.
The text was updated successfully, but these errors were encountered: