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

Simultaneous requests to /api/flickr/most-recent-photos causes server to crash #31

Closed
ryanoshea opened this issue May 17, 2020 · 1 comment

Comments

@ryanoshea
Copy link
Owner

Can't reproduce locally, only on server.

Error [ERR_MULTIPLE_CALLBACK]: Callback called multiple times
at onwrite (_stream_writable.js:437:11)
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:87:12)
at Immediate._onImmediate (/home/ryan/ryanoshea.com/backend/node_modules/handle-thing/lib/handle.js:127:11)
at processImmediate (internal/timers.js:456:21) {
code: 'ERR_MULTIPLE_CALLBACK'
}

@ryanoshea
Copy link
Owner Author

This looks like an incompatibility issue with spdy on Node v12.

Investigation notes:

  • Error originates in a dependency of spdy. There's also a deprecation message on Node v12 with the way this package modifies headers. Possible indication that [email protected] doesn't support Node v12.
  • Reverting to flickrapi doesn't prevent the issue.
  • Simplifying the request down to a single promise that does res.send() in its callback doesn't prevent the issue.
  • Using async/await and moving the res.send() into the body of the request handler doesn't prevent the issue.
  • Removing the async/promise behavior altogether from the request handler fixes the issue.
  • Downgrading to Node v10 fixes the issue.

ryanoshea added a commit that referenced this issue May 17, 2020
Also add nicer frontend handling for when the server returns no photo data.
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

No branches or pull requests

1 participant