You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
demo/boards Render hangs for multiple messages in the avl.Tree
Description
If we change r/demo/boards RenderBoard to first put the posts in an avl.Tree, then Render works for 1050 messages, but hangs after adding another 150 messages.
git clone https://github.com/gnolang/gno
cd gno
make install.gnodev
cd gno.land
make install
If you haven't already done so, add the test_1 key to gnokey. Use the following command, enter a password, repeat the password, and enter the mnemonic "source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast".
gnokey add -recover test_1
cd to the boards realm folder gno/examples/gno.land/r/demo/boards and edit public.gno. Comment out this line so that we can call CreateThread from a Run command.
Edit board.gno and replace RenderBoard with the following which does the same thing, but first adds the messages to an avl.Tree.
We want to use Run to add multiple messages. Create a file add150.gno with the following code which calls CreateThread 150 times. (This is the most we can add with the maximum gas allowed.):
package main
import (
"gno.land/p/demo/ufmt"
"gno.land/r/demo/boards"
)
func main() {
for i := 1; i <= 150; i++ {
boards.CreateThread(1, "title", ufmt.Sprintf("Hello %d", i))
}
}
Add 1050 messages by entering the following Run command 7 times:
Now, enter the Run command above to add another 150 messages. Refresh the browser page.
Expected behaviour
The RenderBoard function renders 1050 messages quickly with no problem. It should be able render quickly after adding another 150 messages.
Actual behaviour
But after adding another 150 messages, the RenderBoard function doesn't return. The web page just keeps waiting. It doesn't time out. Interestingly, gnodev itself is still alive. I can press h to get the help page.
Proposed solution
As a minimum, I hope to work with @gfanton to be able to reproduce the error. (This bug report uses r/demo/boards, but we have a similar problem in GnoSocial which is how we discovered it.)
The text was updated successfully, but these errors were encountered:
jefft0
changed the title
demo/boards Render fails for multiple message
demo/boards Render hangs for multiple messages in avl.Tree
Mar 4, 2024
You're welcome, @zivkovicmilos . As we discussed, I'm trying to turn this into an integration test with txtar, maybe to simplify so that it doesn't depend on r/demo/boards. I'm trying to narrow down the test. I may just be a case where the CPU times out, but the GnoVM doesn't handle it properly.
demo/boards Render hangs for multiple messages in the avl.Tree
Description
If we change r/demo/boards
RenderBoard
to first put the posts in an avl.Tree, then Render works for 1050 messages, but hangs after adding another 150 messages.Here is a video (less than 5 minutes) of reproducing the bug with the following steps.
https://www.loom.com/share/8815320be5674f39b788da0bd8d92aa6
Your environment
Steps to reproduce
CreateThread
from a Run command.RenderBoard
with the following which does the same thing, but first adds the messages to an avl.Tree.CreateThread
150 times. (This is the most we can add with the maximum gas allowed.):RenderBoard
, in a browser go to http://localhost:8888/r/demo/boards:testboard . You can see that the page loads quickly with all 1050 messages.Expected behaviour
The
RenderBoard
function renders 1050 messages quickly with no problem. It should be able render quickly after adding another 150 messages.Actual behaviour
But after adding another 150 messages, the
RenderBoard
function doesn't return. The web page just keeps waiting. It doesn't time out. Interestingly, gnodev itself is still alive. I can pressh
to get the help page.Proposed solution
As a minimum, I hope to work with @gfanton to be able to reproduce the error. (This bug report uses r/demo/boards, but we have a similar problem in GnoSocial which is how we discovered it.)
The text was updated successfully, but these errors were encountered: