Closed (fixed)
Project:
Drupal core
Version:
8.2.x-dev
Component:
database system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Sep 2016 at 15:31 UTC
Updated:
10 Oct 2016 at 15:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hideaway commentedComment #3
cilefen commentedComment #4
xjmWe will need to include this in the release notes for the next release one way or another (whether it's to flag a regression or that this was fixed since RC2).
Comment #5
alexpottAccording to the PHP documentation it says:
(https://secure.php.net/manual/en/function.symlink.php)
@hideaway which version of Windows did this fail on?
Comment #6
alexpottI wonder if there the temp directory is not writable - @hideaway can you run this patch on your environment?
Comment #7
daffie commentedThe solution looks good to me. By throwing an exception for there not being a working temporary directory you are not getting to the infinite loop. All the code in the patch is good enough to be committed. Normally I would give this patch RTBC, but I do not have a Windows system to test this patch. So a big +1 from me.
Comment #8
hideaway commentedHi there.
Patch in #6 did not help and I explain why. In Windows in order to create symlinks you need to have "SeCreateSymbolicLinkPrivilege" privilege, which by default is held only by admin. Developers in our office are using Windows 10 Home and they do not have this privilege (and I really did not find a way how to add this in Win 10 Home). And since they cannot run phpunit command with admin rights or run their IDE (PHPStorm) with admin rights to run the tests from there, their migration tests got stuck in an infinite loop. If I run phpunit command with Admin privilege, of course then symlink is created, however since they cannot do this themselves, I currently patched that line of code to use @copy instead, which at least works for us and our migration tests are not stuck anymore.
Comment #9
daffie commented@hideaway: Could you post the patch or the code changes that you made.
Comment #10
hideaway commented@daffie, of course I can. It was most simple change I could do in order to solve the problem.
Comment #11
daffie commented@hideway: Maybe a stupid question, but do the migration tests now run or are they skipped?
Comment #12
hideaway commentedThey definitely run now :) To check I did the following:
1. I checked I have no test* tables in db
2. I run single test migration (like MigrateNodeTest)
3. Exited the test before db cleanup
4. Can clearly see the test* tables with the data.
Comment #13
daffie commentedWith the explanation of @hideaway am I confident enough to give this patch a RTBC status.
Comment #14
catchCopy isn't atomic, so this could re-introduce the previous race condition.
We could possibly do something with rename()?
Whatever we do, it's going to need an explanatory comment.
Comment #15
fabianx commentedrename() is the only other atomic filesystem operation.
Comment #16
alexpottHere's another idea that will fix windows and probably a few other tricky situations.
Comment #17
alexpottA better comment.
Comment #18
alexpottComment #19
fabianx commentedFirst I didn't like that, but now I think this is a good solution.
Especially for unit tests a concurrency of more than one is just very seldom needed.
I think the patch is fine for both 8.3.x and 8.2.x, but probably needs a small change record or add to the existing yet to be created change record.
Comment #22
catchI think that's a good, honest, limitation.
Added a change record: https://www.drupal.org/node/2806653
Committed/pushed to 8.3.x and cherry-picked to 8.2.x. Thanks!