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
It appears that when newer versions activegraph encounter a deadlock, they hang and no longer responds to signals, meaning the process needs to be kill -9'd. I encountered this in the wild on centos 7 but was able to replicate the hang on osx. This issue did not occur prior to the swap to neo4j-ruby-driver that occurred in 10.x. I do not believe this is related to the thread-saftey issue reported in #1620 as it can occur when a single thread deadlocks with a transaction from another process.
Code example (inline, gist, or repo)
The 'hang' method in the following code run on a fresh db with UUID constraints set for Foo and Bar will replicate the issue.
Note that despite this being a threaded method, this will still occur if you remove the thread block and run 2 instances of the hang method in different processes.
require 'neo4j_ruby_driver'
require 'active_graph/core'
require 'active_graph'
class Foo
include ActiveGraph::Node
property :name, type: String
has_many :out, :bars, type: :foo_bar, model_class: 'Bar', unique: true
end
class Bar
include ActiveGraph::Node
property :name, type: String
has_one :in, :foo, type: :foo_bar, model_class: 'Foo', unique: true
end
module Hang
def setup
ActiveGraph::Base.driver = Neo4j::Driver::GraphDatabase.driver('bolt://localhost:7687', Neo4j::Driver::AuthTokens.basic('neo4j', ''), encryption: false)
end
def hang
setup
threads = (1..5).map do |n|
Thread.new do
(1..100).each do |m|
ActiveGraph::Base.write_transaction do
foo = Foo.find_or_create_by(name: 'test-hang')
Bar.create(foo: foo, name: "#{n}-#{m}-#{Time.now.to_i}")
end
puts "thread: #{n} loop: #{m}"
end
end
end
threads.map(&:join)
end
end
Runtime information:
OS: Found initially on Centos7 replicated on OSX 11.6
Ruby: 2.7.2
Neo4j database version: 3.5.19-1 acrivegraph gem version: 10.1.0 neo4j-ruby-driver gem version: 1.7.5 (ffi)
The text was updated successfully, but these errors were encountered:
It appears that when newer versions activegraph encounter a deadlock, they hang and no longer responds to signals, meaning the process needs to be kill -9'd. I encountered this in the wild on centos 7 but was able to replicate the hang on osx. This issue did not occur prior to the swap to neo4j-ruby-driver that occurred in 10.x. I do not believe this is related to the thread-saftey issue reported in #1620 as it can occur when a single thread deadlocks with a transaction from another process.
Code example (inline, gist, or repo)
The 'hang' method in the following code run on a fresh db with UUID constraints set for Foo and Bar will replicate the issue.
Note that despite this being a threaded method, this will still occur if you remove the thread block and run 2 instances of the hang method in different processes.
Runtime information:
OS: Found initially on Centos7 replicated on OSX 11.6
Ruby: 2.7.2
Neo4j database version: 3.5.19-1
acrivegraph
gem version: 10.1.0neo4j-ruby-driver
gem version: 1.7.5 (ffi)The text was updated successfully, but these errors were encountered: