Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite indexing when using snpapshot version #6390

Closed
Squaess opened this issue May 9, 2024 · 2 comments · Fixed by #6473
Closed

Infinite indexing when using snpapshot version #6390

Squaess opened this issue May 9, 2024 · 2 comments · Fixed by #6473
Labels
bug Something that is making a piece of functionality unusable

Comments

@Squaess
Copy link

Squaess commented May 9, 2024

Describe the bug

When using the metals with the snapshot version the indexing takes forever to complete. I was using the snapshot version for a long time, but since some of the version the indexing stopped to complete. My current snapshot version is: 1.3.0+63-c3e1e8b2-SNAPSHOT. When going back to 1.3.0 indexing starts to work again.

What is more I've noticed that doind the "Clean and restart build server" solves the issue, meaning that the indexing works and I'm able to navigate the code with ease, but there is still an old notification about indexing.
image
image

To Reproduce Steps to reproduce the behavior:

  1. Update the metals server version to the mentioned snapshot
  2. Restart VSCode
  3. Import build
  4. Observe the indexing notification
    Optional:
  5. Click "Clean and restart build server"
  6. Wait for the compilation to finish
  7. Indexing starts to work
  8. The old notification is still present ("indexing")

Expected behavior

Indexing finishes from the first start, no need to restart, and the notification dissapears when completed.

Screenshots

image

Installation:

  • Operating system: Windows 10
  • VSCode version: 1.89.0 (user setup)
  • VSCode extension version: v1.31.0
  • Metals version: 1.3.0+63-c3e1e8b2-SNAPSHOT

Workspace information:

  • Scala versions: 2.12.15
  • Build tools: 0. mvn
  • Build servers:
    0. Bloop v1.5.17
  • All build tools in workspace: Bloop; Maven

Additional context

Metals server logs:

Metals version: 1.3.0+63-c3e1e8b2-SNAPSHOT
Using coursier located at C:\Users\bbanasik\AppData\Local\Coursier\data\bin\coursier.bat
C:\Users\bbanasik\AppData\Local\Coursier\cache\arc\https\github.com\adoptium\temurin8-binaries\releases\download\jdk8u402-b06\OpenJDK8U-jdk_x64_windows_hotspot_8u402b06.zip\jdk8u402-b06\bin\java -version:
openjdk version "1.8.0_402"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_402-b06
C:\Users\bbanasik\AppData\Local\Coursier\cache\arc\https\github.com\adoptium\temurin8-binaries\releases\download\jdk8u402-b06\OpenJDK8U-jdk_x64_windows_hotspot_8u402b06.zip\jdk8u402-b06\bin\java -version:
)
OpenJDK 64-Bit Server VM (Temurin)(build 25.402-b06, mixed mode)
Found java executable under C:\Users\bbanasik\AppData\Local\Coursier\cache\arc\https\github.com\adoptium\temurin8-binaries\releases\download\jdk8u402-b06\OpenJDK8U-jdk_x64_windows_hotspot_8u402b06.zip\jdk8u402-b06\bin\java.exe that resolves to C:\Users\bbanasik\AppData\Local\Coursier\cache\arc\https\github.com\adoptium\temurin8-binaries\releases\download\jdk8u402-b06\OpenJDK8U-jdk_x64_windows_hotspot_8u402b06.zip\jdk8u402-b06\bin\java.exe
C:\Users\bbanasik\AppData\Local\Coursier\cache\arc\https\github.com\adoptium\temurin8-binaries\releases\download\jdk8u402-b06\OpenJDK8U-jdk_x64_windows_hotspot_8u402b06.zip\jdk8u402-b06\bin\java -version:
openjdk version "1.8.0_402"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_402-b06
C:\Users\bbanasik\AppData\Local\Coursier\cache\arc\https\github.com\adoptium\temurin8-binaries\releases\download\jdk8u402-b06\OpenJDK8U-jdk_x64_windows_hotspot_8u402b06.zip\jdk8u402-b06\bin\java -version:
)
OpenJDK 64-Bit Server VM (Temurin)(build 25.402-b06, mixed mode)
No installed java with version 17 found. Will fetch one using coursier.
Coursier: openjdk version "17" 2021-09-14
OpenJDK Runtime Environment Temurin-17+35 (build 17+35)
Coursier: OpenJDK 64-Bit Server VM Temurin-17+35 (build 17+35, mixed mode, sharing)
Using Java Home: C:\Users\bbanasik\AppData\Local\Coursier\cache\arc\https\github.com\adoptium\temurin17-binaries\releases\download\jdk-17%252B35\OpenJDK17-jdk_x64_windows_hotspot_17_35.zip\jdk-17+35
2024.05.09 13:08:21 INFO  logging to files ...\.metals\metals.log
2024.05.09 13:08:21 INFO  Started: Metals version 1.3.0+63-c3e1e8b2-SNAPSHOT in folders '...' for client Visual Studio Code 1.89.0.
Initializing Scala Debugger
Release notes was not shown: not showing release notes since they've already been seen for your current version
2024.05.09 13:08:21 INFO  Flyway Community Edition 9.22.3 by Redgate
2024.05.09 13:08:21 INFO  See release notes here: https://rd.gt/416ObMi
2024.05.09 13:08:21 INFO  
2024.05.09 13:08:21 INFO  Database: jdbc:h2:file: ...\.metals\metals (H2 2.2)
2024.05.09 13:08:21 WARN  Flyway upgrade recommended: H2 2.2.224 is newer than this version of Flyway and support has not been tested. The latest supported version of H2 is 2.2.220.
2024.05.09 13:08:21 INFO  Successfully validated 6 migrations (execution time 00:00.018s)
2024.05.09 13:08:21 INFO  Current version of schema "PUBLIC": 6
2024.05.09 13:08:21 INFO  Schema "PUBLIC" is up to date. No migration necessary.
2024.05.09 13:08:22 INFO  Attempting to connect to the build server...
2024.05.09 13:08:23 INFO  tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at ...\.metals\bsp.trace.json
2024.05.09 13:08:23 INFO  no build target found for .... Using presentation compiler with project's scala-library version: 3.3.3
2024.05.09 13:08:23 INFO  time: Connected to build server in 0.56s
2024.05.09 13:08:23 INFO  Connected to Build server: Bloop v1.5.17
2024.05.09 13:08:23 INFO  time: Imported build in 0.46s
2024.05.09 13:21:03 INFO  Disconnecting from Bloop session...
2024.05.09 13:21:03 INFO  Shut down connection with build server.
2024.05.09 13:21:03 INFO  Deleted directories inside .bloop
2024.05.09 13:21:03 INFO  Attempting to connect to the build server...
2024.05.09 13:21:14 INFO  tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at ...\.metals\bsp.trace.json
2024.05.09 13:21:14 INFO  time: Connected to build server in 10s
2024.05.09 13:21:14 INFO  Connected to Build server: Bloop v1.5.17
2024.05.09 13:21:14 INFO  time: Imported build in 0.28s
2024.05.09 13:21:37 INFO  time: indexed workspace in 22s
2024.05.09 13:21:39 INFO  compiling ... (19 scala sources)
2024.05.09 13:21:54 INFO  compiling ,,,-test (9 scala sources)
2024.05.09 13:21:54 INFO  time: compiled ... in 16s
2024.05.09 13:22:04 INFO  time: compiled ...-test in 9.6s
2024.05.09 13:32:50 INFO  Database: jdbc:h2:file:C:\Users\bbanasik\AppData\Local\Temp\fallback-service1017104531482350671\.metals\metals (H2 2.2)
2024.05.09 13:32:50 WARN  Flyway upgrade recommended: H2 2.2.224 is newer than this version of Flyway and support has not been tested. The latest supported version of H2 is 2.2.220.
2024.05.09 13:32:50 INFO  Schema history table "PUBLIC"."flyway_schema_history" does not exist yet
2024.05.09 13:32:50 INFO  Successfully validated 6 migrations (execution time 00:00.004s)
2024.05.09 13:32:50 INFO  Creating Schema History table "PUBLIC"."flyway_schema_history" ...
2024.05.09 13:32:50 INFO  Current version of schema "PUBLIC": << Empty Schema >>
2024.05.09 13:32:50 INFO  Migrating schema "PUBLIC" to version "1 - Create tables"
2024.05.09 13:32:50 INFO  Migrating schema "PUBLIC" to version "2 - Server discovery"
2024.05.09 13:32:50 INFO  Migrating schema "PUBLIC" to version "3 - Jar symbols"
2024.05.09 13:32:50 INFO  Migrating schema "PUBLIC" to version "4 - Fingerprints"
2024.05.09 13:32:50 INFO  Migrating schema "PUBLIC" to version "5 - Jar type hierarchy"
2024.05.09 13:32:50 INFO  Migrating schema "PUBLIC" to version "6 - Delete indices"
2024.05.09 13:32:50 INFO  Successfully applied 6 migrations to schema "PUBLIC", now at version v6 (execution time 00:00.039s)
2024.05.09 13:32:51 INFO  no build target found for /scala/StringContext.scala. Using presentation compiler with project's scala-library version: 3.3.3

Metals doctor:
image


The issue reported by doctor:

error id: jar:file:///C:/Users/bbanasik/.m2/repository/org/apache/arrow/arrow-vector/11.0.0/arrow-vector-11.0.0-sources.jar!/codegen/templates/BaseReader.java
jar:file:///C:/Users/bbanasik/.m2/repository/org/apache/arrow/arrow-vector/11.0.0/arrow-vector-11.0.0-sources.jar!/codegen/templates/BaseReader.java
### java.lang.Exception: Unexpected symbol at word pos: '35'. Line: '<##include "/@includes/license.ftl" />'

Java indexer failed with and exception.
```Java
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

<@pp.dropOutputFile />
<@pp.changeOutputFile name="/org/apache/arrow/vector/complex/reader/BaseReader.java" />


<#include "/@includes/license.ftl" />

package org.apache.arrow.vector.complex.reader;

<#include "/@includes/vv_imports.ftl" />

/**
 * Source code generated using FreeMarker template ${.template_name}
 */
@SuppressWarnings("unused")
public interface BaseReader extends Positionable{
  Field getField();
  MinorType getMinorType();
  void reset();
  void read(UnionHolder holder);
  void read(int index, UnionHolder holder);
  void copyAsValue(UnionWriter writer);
  void read(DenseUnionHolder holder);
  void read(int index, DenseUnionHolder holder);
  void copyAsValue(DenseUnionWriter writer);
  boolean isSet();

  public interface StructReader extends BaseReader, Iterable<String>{
    FieldReader reader(String name);
  }
  
  public interface RepeatedStructReader extends StructReader{
    boolean next();
    int size();
    void copyAsValue(StructWriter writer);
  }
  
  public interface ListReader extends BaseReader{
    FieldReader reader(); 
  }
  
  public interface RepeatedListReader extends ListReader{
    boolean next();
    int size();
    void copyAsValue(ListWriter writer);
  }

  public interface MapReader extends BaseReader{
    FieldReader reader();
  }

  public interface RepeatedMapReader extends MapReader{
    boolean next();
    int size();
    void copyAsValue(MapWriter writer);
  }
  
  public interface ScalarReader extends  
  <#list vv.types as type><#list type.minor as minor><#assign name = minor.class?cap_first /> ${name}Reader, </#list></#list> 
  BaseReader {}
  
  interface ComplexReader{
    StructReader rootAsStruct();
    ListReader rootAsList();
    boolean rootIsStruct();
    boolean ok();
  }
}


Error stacktrace:

scala.meta.internal.mtags.JavaToplevelMtags.kwOrIdent$1(JavaToplevelMtags.scala:188)
	scala.meta.internal.mtags.JavaToplevelMtags.parseToken$1(JavaToplevelMtags.scala:247)
	scala.meta.internal.mtags.JavaToplevelMtags.fetchToken(JavaToplevelMtags.scala:253)
	scala.meta.internal.mtags.JavaToplevelMtags.loop(JavaToplevelMtags.scala:72)
	scala.meta.internal.mtags.JavaToplevelMtags.indexRoot(JavaToplevelMtags.scala:41)
	scala.meta.internal.mtags.MtagsIndexer.index(MtagsIndexer.scala:21)
	scala.meta.internal.mtags.MtagsIndexer.index$(MtagsIndexer.scala:20)
	scala.meta.internal.mtags.JavaToplevelMtags.index(JavaToplevelMtags.scala:15)
	scala.meta.internal.mtags.Mtags.indexWithOverrides(Mtags.scala:74)
	scala.meta.internal.mtags.SymbolIndexBucket.indexSource(SymbolIndexBucket.scala:130)
	scala.meta.internal.mtags.SymbolIndexBucket.addSourceFile(SymbolIndexBucket.scala:113)
	scala.meta.internal.mtags.SymbolIndexBucket.$anonfun$addSourceJar$2(SymbolIndexBucket.scala:80)
	scala.collection.immutable.List.flatMap(List.scala:294)
	scala.meta.internal.mtags.SymbolIndexBucket.$anonfun$addSourceJar$1(SymbolIndexBucket.scala:76)
	scala.meta.internal.io.PlatformFileIO$.withJarFileSystem(PlatformFileIO.scala:87)
	scala.meta.internal.io.FileIO$.withJarFileSystem(FileIO.scala:44)
	scala.meta.internal.mtags.SymbolIndexBucket.addSourceJar(SymbolIndexBucket.scala:74)
	scala.meta.internal.mtags.OnDemandSymbolIndex.$anonfun$addSourceJar$2(OnDemandSymbolIndex.scala:85)
	scala.meta.internal.mtags.OnDemandSymbolIndex.tryRun(OnDemandSymbolIndex.scala:148)
	scala.meta.internal.mtags.OnDemandSymbolIndex.addSourceJar(OnDemandSymbolIndex.scala:84)
	scala.meta.internal.metals.Indexer.indexJar$1(Indexer.scala:631)
	scala.meta.internal.metals.Indexer.addSourceJarSymbols(Indexer.scala:657)
	scala.meta.internal.metals.Indexer.$anonfun$indexDependencySources$5(Indexer.scala:488)
	scala.collection.IterableOnceOps.foreach(IterableOnce.scala:619)
	scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:617)
	scala.collection.AbstractIterable.foreach(Iterable.scala:935)
	scala.collection.IterableOps$WithFilter.foreach(Iterable.scala:905)
	scala.meta.internal.metals.Indexer.$anonfun$indexDependencySources$1(Indexer.scala:479)
	scala.meta.internal.metals.Indexer.$anonfun$indexDependencySources$1$adapted(Indexer.scala:478)
	scala.collection.IterableOnceOps.foreach(IterableOnce.scala:619)
	scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:617)
	scala.collection.AbstractIterable.foreach(Iterable.scala:935)
	scala.meta.internal.metals.Indexer.indexDependencySources(Indexer.scala:478)
	scala.meta.internal.metals.Indexer.$anonfun$indexWorkspace$24(Indexer.scala:397)
	scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	scala.meta.internal.metals.TimerProvider.timedThunk(TimerProvider.scala:25)
	scala.meta.internal.metals.Indexer.$anonfun$indexWorkspace$23(Indexer.scala:390)
	scala.meta.internal.metals.Indexer.$anonfun$indexWorkspace$23$adapted(Indexer.scala:386)
	scala.collection.immutable.List.foreach(List.scala:334)
	scala.meta.internal.metals.Indexer.indexWorkspace(Indexer.scala:386)
	scala.meta.internal.metals.Indexer.$anonfun$profiledIndexWorkspace$2(Indexer.scala:173)
	scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	scala.meta.internal.metals.TimerProvider.timedThunk(TimerProvider.scala:25)
	scala.meta.internal.metals.Indexer.$anonfun$profiledIndexWorkspace$1(Indexer.scala:173)
	scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	scala.concurrent.Future$.$anonfun$apply$1(Future.scala:687)
	scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467)
	java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	java.base/java.lang.Thread.run(Thread.java:833)

Short summary:

Java indexer failed with and exception.


Search terms

indexing

@tgodzik tgodzik transferred this issue from scalameta/metals-vscode May 9, 2024
@tgodzik tgodzik added this to Triage in Metals Issue Board via automation May 9, 2024
@tgodzik tgodzik added the bug Something that is making a piece of functionality unusable label May 9, 2024
@tgodzik
Copy link
Contributor

tgodzik commented May 9, 2024

Thanks for reporting! It looks like we have an error in the indexer and that might be causing the progress to never finish.

@kasiaMarek
Copy link
Contributor

Actually, I don't think it's stuck, the progress seems to be incorrectly updated if an error is thrown.

@tgodzik tgodzik moved this from Triage to To do in Metals Issue Board May 13, 2024
@kasiaMarek kasiaMarek moved this from To do to In progress in Metals Issue Board Jun 3, 2024
Metals Issue Board automation moved this from In progress to Done Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants