Skip to content

Instantly share code, notes, and snippets.

@dragos
Created November 5, 2016 14:22
Show Gist options
  • Save dragos/6ce3065e685b0f48ed07af9a8454f002 to your computer and use it in GitHub Desktop.
Save dragos/6ce3065e685b0f48ed07af9a8454f002 to your computer and use it in GitHub Desktop.
class EnsimeActor(langServer: EnsimeLanguageServer, config: EnsimeConfig) extends Actor with LazyLogging {
private var project: ActorRef = _
override val supervisorStrategy = OneForOneStrategy(5, 1 minute) {
case e @ ActorInitializationException(actor, message, cause) =>
logger.error(s"Actor failed to initialize", e)
langServer.connection.logMessage(MessageType.Error, s"Error starting ensime: $message")
SupervisorStrategy.Restart
case e =>
logger.error(s"Actor crashed: ", e)
SupervisorStrategy.Restart
}
override def receive = {
case message =>
if (project eq null) {
logger.info("Starting problematic actor now")
project = context.actorOf(Props(classOf[EnsimeProjectServer], langServer, config), "ensimeProject")
}
project forward message
}
}
@dragos
Copy link
Author

dragos commented Nov 5, 2016

[2016-11-05 15:03:00,652] INFO org.github.dragos.vscode.ensime.EnsimeActor - Starting problematic actor now
[2016-11-05 15:03:00,682] INFO org.apache.commons.vfs2.impl.StandardFileSystemManager - Using "/var/folders/d0/p2vnqqmx4355wcfvjsbhd39c0000gn/T/vfs_cache" as temporary files store.
[2016-11-05 15:03:02,880] ERROR akka.actor.OneForOneStrategy - exception during creation
akka.actor.ActorInitializationException: exception during creation
	at akka.actor.ActorInitializationException$.apply(Actor.scala:166)
	at akka.actor.ActorCell.create(ActorCell.scala:596)
	at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456)
	at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478)
	at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:263)
	at akka.dispatch.Mailbox.run(Mailbox.scala:219)
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
	at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
	at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.reflect.InvocationTargetException: null
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
	at akka.util.Reflect$.instantiate(Reflect.scala:66)
	at akka.actor.ArgsReflectConstructor.produce(Props.scala:355)
	at akka.actor.Props.newActor(Props.scala:255)
	at akka.actor.ActorCell.newActor(ActorCell.scala:552)
	at akka.actor.ActorCell.create(ActorCell.scala:578)
	... 9 common frames omitted
Caused by: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/Users/dragos/workspace/ensime/vscode-scala/dragos-vscode-scala/.ensime_cache/index-1.4/write.lock
	at org.apache.lucene.store.Lock.obtain(Lock.java:89)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:707)
	at org.ensime.indexer.lucene.SimpleLucene.<init>(SimpleLucene.scala:69)
	at org.ensime.indexer.IndexService.<init>(IndexService.scala:85)
	at org.ensime.indexer.SearchService.<init>(SearchService.scala:64)
	at org.ensime.core.Project.<init>(Project.scala:45)
	... 18 common frames omitted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment