Skip to content

Instantly share code, notes, and snippets.

@markrmiller
markrmiller / shutdown-proof.md
Created September 20, 2026 00:03
Solr shutdown shard-response classification proof

Shutdown shard-response classification proof

Measured change: 40a1bd3b5d8391400cddc033de282bd6f6b221e6

The Jenkins failure was ChaosMonkeyNothingIsSafeTest.expectedAllReplicaOutageRejectsAndRecovers observing an HTTP 500 while every replica was intentionally stopped. Two server paths produced the same externally incorrect classification:

  1. HttpShardHandler.take() received InterruptedException from the shutdown interrupter after its request core's CoreContainer had shut down.
  2. A distributed coordinator received ConnectException: Connection refused from a shard that had just stopped, and SearchHandler.shardFailure() used its default 500 status.

The change maps only those two shutdown-specific paths to 503. An unrelated thread interrupt and a non-connect I/O failure retain 500.

@markrmiller
markrmiller / build_pylucene.sh
Created August 3, 2025 00:04
build pylucene
#!/usr/bin/env bash
set -Eeuo pipefail
trap 'echo "❌ failed at line ${LINENO}" >&2' ERR
LUCENE_VER=10.0.0
WORKDIR=$(pwd)/pylucene-trunk
PYLUCENE=$WORKDIR/lucene-pylucene
LUCENE_DIR=$PYLUCENE/lucene-java-$LUCENE_VER
JAVA_HOME=/usr/lib/jvm/java-21-openjdk
JDK_PKG=jdk21-openjdk
@torch.no_grad()
def __call__(
self,
video_path: str,
audio_path: str,
video_out_path: str,
video_mask_path: str = None,
num_frames: int = 16,
video_fps: int = 25,
audio_sample_rate: int = 16000,
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
#!/bin/bash
# Define Solr version
SOLR_VERSION="9.5.0"
SOLR_COLLECTION="testCreateWithDefaultConfigSet"
SOLR_ZK="localhost:14332/solr"
SOLR_DIR="solr-$SOLR_VERSION"
/*
* 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
*
import tkinter as tk
import os
import glob
from pathlib import Path
from tkinter import filedialog
from PIL import Image, ImageTk
class ImageManager:
@markrmiller
markrmiller / asf-oauth-example.py
Created October 12, 2021 05:22 — forked from Humbedooh/asf-oauth-example.py
ASF Oauth Examples
#!/usr/bin/env python3
""" ASF OAuth example in Python 3"""
import cgi
import os
import requests
import urllib
import uuid
def init_oauth():