Infinite loop/very long running task
Reported by Fabien Franzen (loob2) | May 3rd, 2008 @ 06:18 PM
I started out with this - using a clean db:
require 'rubygems'
require 'strokedb'
FileUtils.rm_rf 'test.strokedb' # cleanup the database
StrokeDB::Config.build :default => true, :base_path => 'test.strokedb'
include StrokeDB
Node = Meta.new do
validates_presence_of :label
# on_initialization do |node|
# node.nodes = [] unless node[:nodes]
# end
end
root = Node.named('root', :label => 'root')
# root = Node.named('root')
p Node.find
then I comment-out the db-rebuild steps:
require 'rubygems'
require 'strokedb'
# FileUtils.rm_rf 'test.strokedb' # cleanup the database
StrokeDB::Config.build :default => true, :base_path => 'test.strokedb'
include StrokeDB
Node = Meta.new do
validates_presence_of :label
# on_initialization do |node|
# node.nodes = [] unless node[:nodes]
# end
end
# root = Node.named('root', :label => 'root')
root = Node.named('root')
p Node.find
Everything is still fine. Then I uncomment the on_initialization code block:
require 'rubygems'
require 'strokedb'
# FileUtils.rm_rf 'test.strokedb' # cleanup the database
StrokeDB::Config.build :default => true, :base_path => 'test.strokedb'
include StrokeDB
Node = Meta.new do
validates_presence_of :label
on_initialization do |node|
node.nodes = [] unless node[:nodes]
end
end
# root = Node.named('root', :label => 'root')
root = Node.named('root')
p Node.find
This runs very long, probably in an infinite loop (didn't wait for it to finish after 30 secs).
Comments and changes to this ticket
-
Yurii Rashkovskii May 3rd, 2008 @ 06:37 PM
it seems that this buggy behavior is effective only when doing Node.find(), which uses old index.
Will investigate more...
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
StrokeDB is an embeddable distributed document database written in Ruby
