question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running Sleuth in a process along embedded Neo4j instance will result in blocking.

See original GitHub issue

Describe the bug By default, sleuth will attach to all Executors assuming everything is based on Spring and can be ignored with spring.sleuth.async.ignored-beans. However, for running heavier libraries such as Neo4j this is not enough.

Sample Currently, an call to the embedded neo4j service will block on the following:

"neo4j.BoltWorker-5 [bolt] [/127.0.0.1:54607] @6931" prio=5 tid=0x1c nid=NA waiting for monitor entry
  java.lang.Thread.State: BLOCKED
	 waiting for Test worker@1665 to release lock on <0x598e> (a java.util.concurrent.ConcurrentHashMap)
	  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:183)
	  at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:517)
	  at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:533)
	  at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:505)
	  at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:482)
	  at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:475)
	  at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1158)
	  at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:422)
	  at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:352)
	  at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:345)
	  at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1126)
	  at org.springframework.cloud.sleuth.internal.LazyBean.get(LazyBean.java:64)
	  at org.springframework.cloud.sleuth.instrument.reactor.ReactorSleuth.lambda$scopePassingSpanOperator$0(ReactorSleuth.java:104)
	  at org.springframework.cloud.sleuth.instrument.reactor.ReactorSleuth$$Lambda$3687/0x0000000801c491a0.apply(Unknown Source:-1)
	  at reactor.core.publisher.FluxLift.subscribeOrReturn(FluxLift.java:50)
	  at reactor.core.publisher.Flux.subscribe(Flux.java:8311)
	  at reactor.core.publisher.Flux.subscribeWith(Flux.java:8494)
	  at org.neo4j.fabric.stream.Rx2SyncStream.<init>(Rx2SyncStream.java:45)
	  at org.neo4j.fabric.bolt.BoltQueryExecutionImpl.<init>(BoltQueryExecutionImpl.java:55)
	  at org.neo4j.fabric.bolt.BoltFabricDatabaseService$BoltTransactionImpl.executeQuery(BoltFabricDatabaseService.java:166)
	  at org.neo4j.bolt.runtime.statemachine.impl.AbstractTransactionStateMachineSPI$AbstractBoltResultHandle.start(AbstractTransactionStateMachineSPI.java:135)
	  at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine$State.startExecution(TransactionStateMachine.java:534)
	  at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine$State$2.run(TransactionStateMachine.java:330)
	  at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine.run(TransactionStateMachine.java:84)
	  at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine.run(TransactionStateMachine.java:77)
	  at org.neo4j.bolt.v4.runtime.InTransactionState.processRunMessage(InTransactionState.java:81)
	  at org.neo4j.bolt.v4.runtime.InTransactionState.processUnsafe(InTransactionState.java:48)
	  at org.neo4j.bolt.v3.runtime.FailSafeBoltStateMachineState.process(FailSafeBoltStateMachineState.java:48)
	  at org.neo4j.bolt.runtime.statemachine.impl.AbstractBoltStateMachine.nextState(AbstractBoltStateMachine.java:143)
	  at org.neo4j.bolt.runtime.statemachine.impl.AbstractBoltStateMachine.process(AbstractBoltStateMachine.java:91)
	  at org.neo4j.bolt.messaging.BoltRequestMessageReader.lambda$doRead$1(BoltRequestMessageReader.java:90)
	  at org.neo4j.bolt.messaging.BoltRequestMessageReader$$Lambda$3064/0x0000000801939af0.perform(Unknown Source:-1)
	  at org.neo4j.bolt.runtime.DefaultBoltConnection.lambda$enqueue$0(DefaultBoltConnection.java:148)
	  at org.neo4j.bolt.runtime.DefaultBoltConnection$$Lambda$3065/0x0000000801939d18.perform(Unknown Source:-1)
	  at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatchInternal(DefaultBoltConnection.java:237)
	  at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:172)
	  at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:162)
	  at org.neo4j.bolt.runtime.scheduling.ExecutorBoltScheduler.executeBatch(ExecutorBoltScheduler.java:246)
	  at org.neo4j.bolt.runtime.scheduling.ExecutorBoltScheduler.lambda$scheduleBatchOrHandleError$3(ExecutorBoltScheduler.java:229)
	  at org.neo4j.bolt.runtime.scheduling.ExecutorBoltScheduler$$Lambda$3068/0x000000080193a3c8.get(Unknown Source:-1)
	  at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1764)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	  at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	  at java.lang.Thread.run(Thread.java:832)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ahassanycommented, Feb 11, 2021

2.2.6.RELEASE and 2.2.7.BUILD-SNAPSHOT

0reactions
marcingrzejszczakcommented, Feb 19, 2021

OK! Ping us back once you can reproduce the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transaction management - Java Reference - Neo4j
Neo4j transaction management, including interaction cycle, isolation levels, default locking behavior, deadlocks, delete semantics, creating unique nodes, ...
Read more >
Using Neo4j embedded in Java applications - Java Reference
Using Neo4j embedded in Java applications. This section describes how to use Neo4j embedded in Java applications. The following topics are:.
Read more >
Error handling - Operations Manual - Neo4j
A quarantined state is persisted for user databases. This means that if a database is quarantined, it will remain so even if that...
Read more >
Filtering Query Results - Developer Guides - Neo4j
Upon finishing this guide, you should be able to filter results on properties and patterns for ranges and other expanded searches.
Read more >
Transactions - Neo4j Cypher Manual
This section describes how Cypher queries work with database transactions. All Cypher queries run within transactions. Modifications done by updating queries ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found