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

PHP 8 Support #81

Merged
merged 1 commit into from
Nov 2, 2020
Merged

PHP 8 Support #81

merged 1 commit into from
Nov 2, 2020

Conversation

viezel
Copy link
Contributor

@viezel viezel commented Oct 30, 2020

Added support for PHP8.

@viezel
Copy link
Contributor Author

viezel commented Oct 30, 2020

I should say I battled a bit with your test in another php8 branch, but did not get them to work, as they seem a bit inconsistent. I wanted to bring 8.0 into the test matrix, but it was not that easy since both dependencies are wrong and test fails :) I hope this is fine for now. Else let me know and we should discuss.

see here: https://github.com/viezel/sushi/actions/runs/337448990.

@viezel viezel mentioned this pull request Oct 30, 2020
3 tasks
@calebporzio calebporzio merged commit 8624f60 into calebporzio:master Nov 2, 2020
@calebporzio
Copy link
Owner

Thanks!

calebporzio pushed a commit that referenced this pull request Aug 11, 2021
After introducing sushi to our project, our monitoring tool reported the following
error (stacktrace shortened for brevity):

```
PDOException: SQLSTATE[HY000]: General error: 1 table "schmelzkurve_scoring_table_results" already exists
#88 /vendor/laravel/framework/src/Illuminate/Database/Connection.php(485): PDOStatement::execute
#87 /vendor/laravel/framework/src/Illuminate/Database/Connection.php(485): Illuminate\Database\Connection::Illuminate\Database\{closure}
#86 /vendor/laravel/framework/src/Illuminate/Database/Connection.php(685): Illuminate\Database\Connection::runQueryCallback
#85 /vendor/laravel/framework/src/Illuminate/Database/Connection.php(652): Illuminate\Database\Connection::run
#84 /vendor/laravel/framework/src/Illuminate/Database/Connection.php(486): Illuminate\Database\Connection::statement
#83 /vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php(109): Illuminate\Database\Schema\Blueprint::build
#82 /vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(365): Illuminate\Database\Schema\Builder::build
#81 /vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(228): Illuminate\Database\Schema\Builder::create
#80 /vendor/calebporzio/sushi/src/Sushi.php(142): App\Models\SchmelzkurveScoringTableResult::createTable
#79 /vendor/calebporzio/sushi/src/Sushi.php(89): App\Models\SchmelzkurveScoringTableResult::migrate
#78 /vendor/calebporzio/sushi/src/Sushi.php(45): App\Models\SchmelzkurveScoringTableResult::Sushi\{closure}
#77 /vendor/calebporzio/sushi/src/Sushi.php(66): App\Models\SchmelzkurveScoringTableResult::bootSushi
```

This error can happen in rare circumstances due to a race condition.
Concurrent requests may both see the necessary preconditions for
the table creation, but only one can actually succeed.

My initial attempt at resolving this was to look for a method that
creates the table only if it does not exist (`create table if not exists`),
but Laravel exposes no such method. Thus, I think the only viable solution
is to risk it and catch the resulting error.
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.

2 participants