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

Error occurs when trying to create multiple short URLs simultaneously #522

Closed
acelaya opened this issue Nov 1, 2019 · 0 comments · Fixed by #523
Closed

Error occurs when trying to create multiple short URLs simultaneously #522

acelaya opened this issue Nov 1, 2019 · 0 comments · Fixed by #523
Assignees
Labels
Milestone

Comments

@acelaya
Copy link
Member

acelaya commented Nov 1, 2019

How Shlink is set-up

  • Shlink Version: All
  • PHP Version: All
  • How do you serve Shlink: Anything using swoole
  • Database engine used: All

Summary

Some benchmarking and load testing has been done as part of #436, showing that an exception is thrown when multiple parallel users try to create new short URLs which include both existing and new tags.

Some of them work, but others fail because they try to insert the existing tags as if they were new, throwing an error due to a duplicated key:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'foo' for key 'UNIQ_6FBC94265E237E06'

The issue only happens when serving the app with swoole, and only if more than one worker is used.

It feels like all workers are sharing either the EntityManager, the unit of work or the database connection, but swoole docs say every worker has it's own instance of the app and they don't share the memory.

https://github.com/swooletw/laravel-swoole/wiki/2.-Swoole-Structure

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

Successfully merging a pull request may close this issue.

1 participant