-
Notifications
You must be signed in to change notification settings - Fork 40
http request to localhost is hanging #42
Comments
I'm facing the same problem with s3 offline (but also with a bucket on a real s3). |
Noticed it only happens if scheduler is started with "sls offline". Requests work fine if started with sls schedule |
I don't really know what effect this plugin would have on http requests. At
it's core, it's just a node process that is scheduling a call to
`process.execFile` that's equivalent to `sls invoke local --function
functionName`
…On Tue, Jan 14, 2020 at 12:48 PM Max Gedikli ***@***.***> wrote:
Noticed it only happens if scheduler is started with "sls offline".
Requests work fine if started with sls schedule
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#42?email_source=notifications&email_token=AACBDNYDLMQMJ6VZ6HT6XL3Q5X3FDA5CNFSM4KFYVSIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI5QMGY#issuecomment-574293531>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACBDN46OMNDDOKYJJGCKRDQ5X3FDANCNFSM4KFYVSIA>
.
|
Not familiar with the code base.. wondering if it could be related to the order of scheduler and serverless start, http calls to outside domains work, it only hangs if we're calling lambda function (by making a request to localhost) within the scheduler that was started with |
That could be it. If the scheduled lambda is fired at the same time as the
offline http server, it's possible the server isn't listening when the
scheduled lambda is invoked. If that was the case though, it should
definitely work the next time the lambda is invoked.
…On Tue, Jan 14, 2020 at 2:09 PM Max Gedikli ***@***.***> wrote:
Not familiar with the code base.. wondering if it could be related to the
order of scheduler and serverless start, http calls to outside domains
work, it only hangs if we're calling lambda function (by making a request
to localhost) within the scheduler that was started with sls offline start
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#42?email_source=notifications&email_token=AACBDN55E2BKIKN5BELFX7DQ5YEU3A5CNFSM4KFYVSIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI5YIZI#issuecomment-574325861>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACBDN5VHJZNTY63P456UPDQ5YEU3ANCNFSM4KFYVSIA>
.
|
@maxgedikli There is a workaround that helped me with a similar issue - sending HTTP requests to localhost in scheduled Lambda functions:
Not sure if if's the right approach or not - I don't have a capacity atm to debug further, but it works for my use cases. |
I am having same issue and here is my observation.
|
The issue is with
Note: ** the method will not return until the child process has fully closed.** If you do not close network connections, i.e. redis, mysql, the process will never return. If you set the lambda context I have a potential fix and will open a PR. |
see #46 |
@rokso same issue here, but instead HTTP I'm using Kinesis events. |
Trying to send websocket messages to connected clients by making a call to
http://localhost:3001/@connections/{connectionId}
however all http calls tolocalhost:3000
orlocalhost:3001
are hanging. Works if the lambda function is invoked directly, without serverless-offline-scheduler.The text was updated successfully, but these errors were encountered: