Skip to content
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

Write temp files to /tmp #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

barodeur
Copy link

As suggested by @lucabarze in #145 this fix should fix the problem we have when using sync requests on AWS Lambda.

This should help solving driverdan#145
@demsey2
Copy link

demsey2 commented Jan 18, 2018

I tried that with AWS Lambda and it works fine, however, my initial issue was with Google Cloud Function. The introduced changed in this PR doesn't work. I believe the main problem is with a different approach to the /tmp directory in GCF.
According to their docs "Cloud Functions provides access to a local disk mount point (/tmp) which is known as a "tmpfs" volume in which data written to the volume is stored in memory.". So when we create syncFile in the parent process and then we try to unlink in the child process, it doesn't work the file doesn't exist. So we end up with an infinite loop caused by the while loop.

I managed to fix that by calling spawnSync to check if syncFile exists in the child process.

@barodeur
Copy link
Author

Sorry to hear this doesn't help you.
Do you confirm that node-XMLHttpRequest works with Lambda without this fix? Should I close this pull request?

@demsey2
Copy link

demsey2 commented Jan 18, 2018

you need that fix for AWS Lambda for Google Functions you need more changes

@barodeur
Copy link
Author

Thanks for the clarification

@hmoog
Copy link

hmoog commented Jun 13, 2018

checkout https://www.npmjs.com/package/xmlhttprequest-ts - i added your pull request

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

Successfully merging this pull request may close these issues.

3 participants