Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Hugo server crashes when lots of content files change within a short period of time #6193
I programatically delete and regenerate directories and markdown files. Running Hugo server at the same time often causes Hugo v0.56.3/extended windows/amd64 to crash. Here ist the log:
and open 3 terminals.
since this issue is multithreaded, you may need to repeat the command multiple times in the third terminal.
If the reproduction is successful, you will see the above message. the above appears to be a problem in
first, I checked
as the error suggests, the wrong memory reference is the problem. To see this, I added a simple code above
The result is
If this field is nil:
I checked if nil is assigned in
If you look at the code a little bit further, you can see that all three of these things run on different goroutines.
At this point,
In this case, this problem occurs when each goroutine is executed in the following order.