profile
viewpoint
Jakub Kubryński jkubrynski @Devskiller https://devskiller.com/techblog Devskiller.com co-founder

jkubrynski/jpa-tuning 6

JPA tuning sandbox project

jkubrynski/LK8000 1

LK8000 Tactical Flight Computer main repo

jkubrynski/ansible-modules-core 0

Ansible modules - these modules ship with ansible

jkubrynski/arquillian-core 0

Arquillian provides a component model for integration tests, which includes dependency injection and container life cycle management. Now, instead of having to manage a runtime in your test, Arquillian brings your test to the runtime. Arquillian Core, Container Extension + Protocols + Enrichers

jkubrynski/asciidoctor-extensions-lab 0

A lab and incubator for Asciidoctor extensions.

issue openedgoogleapis/java-storage

Storage Client doesn't offer method to update blob metadata

It's possible to update object metadata (like a custom fields) using gsutil or REST API. However, it's not possible directly with the Java client.

created time in 2 months

Pull request review commentDataDog/dd-trace-java

Add config to capture stacktrace when a span duration exceeds threshold

   private static final boolean DEFAULT_DB_CLIENT_HOST_SPLIT_BY_INSTANCE = false;   private static final String DEFAULT_SPLIT_BY_TAGS = "";   private static final int DEFAULT_PARTIAL_FLUSH_MIN_SPANS = 1000;+  private static final int DEFAULT_SPAN_DURATION_STACKTRACE_MILLIS =+      (int) TimeUnit.SECONDS.toMillis(1);

Depending on a use-case of course, but for regular web applications 1 second is a strict setting, and many users can be flooded.

tylerbenson

comment created time in 2 months

Pull request review commentDataDog/dd-trace-java

Add config to capture stacktrace when a span duration exceeds threshold

 private void finishAndAddToTrace(final long durationNano) {     // ensure a min duration of 1     if (this.durationNano.compareAndSet(0, Math.max(1, durationNano))) {       log.debug("Finished: {}", this);+      addStacktraceIfThresholdExceeded();       context.getTrace().addSpan(this);     } else {       log.debug("{} - already finished!", this);     }   } +  private void addStacktraceIfThresholdExceeded() {+    final long spanDurationStacktraceNanos = Config.get().getSpanDurationStacktraceNanos();+    if (!isError()+        && spanDurationStacktraceNanos > 0+        && durationNano.get() > spanDurationStacktraceNanos+        // If this span was finished async, then the stacktrace will be less meaningful.+        && context.threadId == Thread.currentThread().getId()) {+      final Exception stacktrace = new Exception();+      final Writer stackString = new FilteredStringWriter();+      stacktrace.printStackTrace(new PrintWriter(stackString));+      setTag("slow.stack", stackString.toString());+    }+  }++  // Writer that skips the first line and lines until FILTER doesn't match.+  private static final class FilteredStringWriter extends Writer {+    private static final char[] FILTER = "\tat datadog.opentracing.".toCharArray();++    private final StringWriter writer = new StringWriter();++    private State state = State.SKIP_LINE; // Skip the exception type and message+    private StringBuilder buffer = new StringBuilder();+    private int lineIndex = 0;++    @Override+    public void write(final char[] cbuf, final int off, final int len) throws IOException {+      if ((off < 0)

It would be useful to make the filter configurable. There is often a lot of framework code that can be ignored. I'd even consider including only frames from my code. It worked great in mjprof

tylerbenson

comment created time in 2 months

issue openedspring-projects/spring-integration

Leader election lock is acquired for 9223370472786555805 ms

We're using the LockRegistryLeaderInitiator mechanism to control leader election in the cluster backed with Hazelcast. I see that it uses tryLock(long time, TimeUnit unit) method without specifying the maximum lease time. In fact, it's possible that without graceful shutdown the instance won't release the lock and then no other leader will be elected. All instances then are logging Acquiring the lock for LockContext{role=my-app-leader, id={{app-uuid}}, isLeader=false}

Without manually forcing unlock the whole cluster is stuck. I know that the java.util.concurrent.locks.Lock doesn't offer locking for a given time, but it's supported for example with the com.hazelcast.core.ILock.tryLock(long time, TimeUnit unit, long leaseTime, TimeUnit leaseUnit) method.

Maybe simple possibility to override LeaderSelector.call lock acquisition part could be extracted so users can override it with and provide max lease time for example? It could be also done for example in the spring-integration-hazelcast module.

created time in 4 months

PublicEvent
more