public static int pid() {
        if (Pid.PID <= 0) {
            throw new IllegalStateException("Failed to retrieve the current PID.");
        }
        return Pid.PID;
    }
Returns the current process ID.

@throws IllegalStateException if failed to retrieve the current process ID.
core/src/main/java/com/linecorp/armeria/common/util/SystemInfo.java