Skip to content

Instantly share code, notes, and snippets.

View janhoy's full-sized avatar

Jan Høydahl janhoy

View GitHub Profile
@janhoy
janhoy / solr-picocli-port-prompt.md
Last active October 6, 2026 13:29
Coding-agent prompt: port a Solr CLI tool from commons-cli to picocli

Coding-agent prompt: port a Solr CLI tool to picocli

Assignment

You will work on the CLI class XxxTool — and YyyTool, ZzzTool, … if the issue covers several related tools.

Edit that one line to name your class or classes, then leave the rest of this prompt as it is. Everything below is written against whatever you just declared. Where a step shows a specific class or filename, treat it as a worked example of the pattern and apply it to your own tool; where it says "the tool", it means the class you declared. If you declared several, carry out every step for each of them in the same change.

Branch from main and target main. The picocli framework, the shared mixins and a dozen already-ported tools are all in main — so you are extending an established pattern, not building one.

@janhoy
janhoy / Solr-JSON-lenient.md
Last active September 17, 2026 12:10
Documentation of Solr's lenient and non-standard JSON parsing

Solr's lenient / non-conformant JSON: what the code does vs. what we document

Exploring strict JSON parsing everywhere in Solr. This document inventories the leniency we have today, what we have publicly promised, and how to get from one to the other.

SOLR-18191: Disable lenient json parsing at API level scopes itself to the JSON Request API and the v2 API, and proposes a flag whose default flips across releases.

This document looks at all JSON parsing in Solr, not only V2 API, and proposes a wider approach.

Research notes, 2026-09-17. Code findings are from main (11.0-alpha) and were verified by running bodies through JsonLoader directly. Documentation quotes and links are from the

@janhoy
janhoy / GracefulRepro.java
Created July 4, 2026 01:42
Repro: Jetty 12.1.10 HTTP/2 client loses in-flight response during server graceful shutdown (regression from jetty/jetty.project#15134)
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.InputStreamResponseListener;
import org.eclipse.jetty.http2.client.HTTP2Client;
import org.eclipse.jetty.http2.client.transport.HttpClientTransportOverHTTP2;
import org.eclipse.jetty.http2.server.HTTP2CServerConnectionFactory;
import org.eclipse.jetty.server.Handler;
@janhoy
janhoy / DEPRECATIONS.md
Last active June 15, 2026 22:44
Apache Solr - Deprecated Java Code Inventory

Deprecated Java Code in Apache Solr

Purpose: Inventory of every @Deprecated element in the Solr Java source tree, with the date and Solr release in which the deprecation first shipped, plus whether it is present in branch_10x. Use this to plan removal of deprecated code and to decide whether a removal applies to main only or also to branch_10x.

Scanned 2026-06-16. main base version 11.0.0-SNAPSHOT; latest GA 10.0.0. 162 @Deprecated annotations across 90 files, all under solr/.

Tracking removals

The first column is a checkbox. Tick it ([ ] → [x]) by editing this gist when the deprecation has been removed.

@janhoy
janhoy / current-main.txt
Last active March 12, 2025 19:05
Solr start usage
Usage: solr start [-f] [--user-managed] [--host host] [-p port] [--server-dir directory] [-z zkHost] [-m memory]
[-e example] [--solr-home solr.solr.home] [--data-home solr.data.home] [--jvm-opts "jvm-opts"] [--verbose]
-f/--foreground Start Solr in foreground; default starts Solr in the background
and sends stdout / stderr to solr-PORT-console.log
--user-managed Start Solr in user managed aka standalone mode
See the Ref Guide for more details: https://solr.apache.org/guide/solr/latest/deployment-guide/cluster-types.html
--host <host> Specify the hostname for this Solr instance
@janhoy
janhoy / chatgpt-answer.md
Created August 19, 2024 22:21
Scout prompt answer

To align OpenSearch with the energy and recognition that comes from an iconic mascot, we should select a character that captures the essence of openness, collaboration, and search functionality while resonating with a broad audience. Here's a possible direction for the mascot:

Mascot Concept: "Scout"

Name: Scout
Species/Character: A curious and adventurous Fox
Symbolism:

  • Fox is often associated with intelligence, curiosity, and agility. These traits mirror the qualities of a search engine, particularly one that is highly performant and adaptable like OpenSearch.
  • Scout evokes the idea of searching, exploring, and discovering new possibilities—core themes of what OpenSearch does. The name also suggests reliability, as a scout typically leads the way, ensuring safety and success for others.
@janhoy
janhoy / log.log
Created June 5, 2024 10:05
Stack trace solr create collection
2024-06-05 09:45:08.258 INFO (OverseerThreadFactory-169-thread-5) [c:jan-5 s: r: x: t:] o.a.s.c.a.c.CreateCollectionCmd Create collection jan-5
2024-06-05 09:45:08.455 ERROR (OverseerThreadFactory-169-thread-5) [c:jan-5 s: r: x: t:] o.a.s.c.p.i.AttributeFetcherImpl Received unsolicited snitch tag heapUsage from node NodeImpl(test-solr-9-solrcloud-0.test-solr-9-solrcloud-headless.test-solr:8983_solr)
2024-06-05 09:45:08.455 ERROR (OverseerThreadFactory-169-thread-5) [c:jan-5 s: r: x: t:] o.a.s.c.p.i.AttributeFetcherImpl Received unsolicited snitch tag sysLoadAvg from node NodeImpl(test-solr-9-solrcloud-0.test-solr-9-solrcloud-headless.test-solr:8983_solr)
2024-06-05 09:45:08.455 ERROR (OverseerThreadFactory-169-thread-5) [c:jan-5 s: r: x: t:] o.a.s.c.p.i.AttributeFetcherImpl Received unsolicited snitch tag freedisk from node NodeImpl(test-solr-9-solrcloud-0.test-solr-9-solrcloud-headless.test-solr:8983_solr)
2024-06-05 09:45:08.455 ERROR (OverseerThreadFactory-169-thread-5) [c:jan-5 s: r: x: t:] o.a.s.c.p.i.A
@janhoy
janhoy / solr-dependency-report.txt
Created February 25, 2022 09:38
Solr dependency scan
> Task :dependencyUpdates
------------------------------------------------------------
: Project Dependency Updates (report to plain text file)
------------------------------------------------------------
The following dependencies are using the latest milestone version:
- ca.cutterslade.analyze:ca.cutterslade.analyze.gradle.plugin:1.8.3
- com.cybozu.labs:langdetect:1.1-20120112
- com.diffplug.spotless:com.diffplug.spotless.gradle.plugin:6.3.0
@janhoy
janhoy / Solr dependencies main.txt
Created February 23, 2022 13:09
Solr dependencies
runtimeClasspath - Runtime classpath of source set 'main'.
+--- project :solr:core
| +--- org.apache.lucene:lucene-core:9.0.0
| +--- org.apache.lucene:lucene-analysis-common:9.0.0
| | \--- org.apache.lucene:lucene-core:9.0.0
| +--- org.apache.lucene:lucene-queries:9.0.0
| | \--- org.apache.lucene:lucene-core:9.0.0
| +--- org.slf4j:slf4j-api:1.7.36
| +--- project :solr:solrj
| | +--- org.eclipse.jetty.http2:http2-client:9.4.44.v20210927
@janhoy
janhoy / branchToTag.sh
Last active March 10, 2021 22:21
branchToTag.sh
#!/bin/bash
branctotag() {
BRANCH=$1
REMOTE=$2
if [[ $# -lt 2 ]]; then
echo "Usage: ./branchToTag.sh <branch-name> <remote>"
echo "Example: ./branchToTag.sh jira/SOLR-123 origin"
echo " ...will create tag history/branches/lucene-solr/jira/SOLR-123 and delete the branch"
exit 0