pydio / cells

Future-proof content collaboration platform
https://pydio.com
GNU Affero General Public License v3.0
1.83k stars 180 forks source link

Racing condition when running `go test` (3.0.0-RC3) #363

Closed GwynethLlewelyn closed 2 years ago

GwynethLlewelyn commented 3 years ago

I ran go test -race -v ./... on the latest version (4dd2a9d40466af3b08093699018215d34c0b9218 I believe) and the tests showed a racing condition. The log is quite extensive (full paths redacted), so I'm attaching it here: compilation.test.log

I cannot 'see' anything wrong when running Cells, but, alas, perhaps it's worth taking a look at what causes the racing condition...

Tested using macOS Big Sur 11.6.1 (20G211) with go 1.17.1 (darwin/amd64).

A test using Ubuntu Linux 20.04.3 LTS with a quad-core, 2-threads-per-core Intel(R) Xeon(R) CPU E3-1275 v5 @ 3.60GHz with 64 GBytes of RAM (go 1.17.1 linux/amd64) finished with pretty much the same result: compilation.test.linux.log

I'm also trying to run the same tests on a quad-core Cortex A53 processor (ARMv8 @1.4GHz, 1 GB RAM) [Realtek/RTD1296] running Linux, but that will take several hours to finish (if at all). If the results are the same, I'll be posting them here as well.

(Sorry, I have no Windows machine available to run that test!)

GwynethLlewelyn commented 3 years ago

Sadly, I couldn't complete the tests on the ARM machine. Apparently, to run the racing tests, the Linux kernel needs to be compiled with '48-bit VMA', which, honestly, I tried to look up to see what it is but couldn't understand the explanation anyway. Allegedly, all Linux kernels running on top of Intel/AMD chips will have these 48-bit VMAs. By contrast, the Linux kernels running on top of ARM chips may have 48-bit VMAs, but they usually have a different size (allegedly, that way, some memory gets saved — one assumes that ARM machines have a tiny memory footprint). go test eventually even figures out how many bits the VMA has — in my case, 39 instead of 48 — and skips the racing test. As such, the test was completely inconclusive.

Ironically, just today, I saw that Go had been upgraded to 1.17.2 (and there are a few more patches to the Pydio Cells code!), so I ran the tests again under macOS and Ubuntu Linux, just to see if there was any difference — but no, the results are identical with what I've reported yesterday. I guess it's not really an issue with the Go compiler/linker/tools. And since I've ran that only now, I have no idea if the racing condition was already being flagged under previous versions of Pydio Cells, or if those are only present in the 3.0.0 RC series...

GwynethLlewelyn commented 2 years ago

I've closed this issue since I'm assuming it's fixed on the newer releases 🤓 ... but I haven't tested it again!