Post

2024-08-01-TIL

2024-08-01-TIL

Today I Learned

Minting in NFT

민팅(Minting)이란 NFT를 발행하는 것으로 그림, 영상 등의 디지털 자산의 NFT를 생성하는 것이다. ‘화폐를 주조하다’라는 뜻의 영어단어인 mint에서 유래됐다. 디지털 파일을 블록체인 위에 올리고 해당 파일을 내 소유로 등록하기 위해 블록체인 지갑을 사용해 연결한다.

  • https://news.sktelecom.com/176795#:~:text=%EB%AF%BC%ED%8C%85(Minting)%EC%9D%B4%EB%9E%80%20NFT%EB%A5%BC,%EC%A7%80%EA%B0%91%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%B4%20%EC%97%B0%EA%B2%B0%ED%95%9C%EB%8B%A4.
  • https://brunch.co.kr/@gapcha/195
  • https://post.naver.com/viewer/postView.naver?volumeNo=34569208&memberNo=40921089

ClientAbortException Handling Best Practice

특정 조회 기능에서 응답시간이 빠르지 않아서 종종 ClientAbortException이 발생한다. 원인은 말 그대로 응답응 수신하기도 전에 클라이언트 측에서 일방적으로 커넥션을 끊어버리는 것이다. 페이지 로딩 중에 창을 종료한다던지 브라우저를 종료하는 경우에 발생할 수 있다.

Sentry AI Solution은 다음과 같다.

Problem Description Looks like we have a ClientAbortException with a lovely message of java.io.IOException: Broken pipe. Ah, the broken pipe, a classic error that never fails to frustrate. This error occurred in the doFlush method of the org.apache.catalina.connector.OutputBuffer class, specifically at line 305. So, it seems something went wrong while flushing the output buffer.

But wait, there’s more! This error was raised during the handling of a previous exception, an IOException with the same message of a broken pipe. This time, the error occurred in the write0 method of the sun.nio.ch.SocketDispatcher class, crashing right at line 62. Looks like another broken pipe issue while writing to a socket.

Proposed Solution To fix this broken pipe error, we need to handle the exception and gracefully recover from it. In the doFlush method of the org.apache.catalina.connector.OutputBuffer class, we should catch the ClientAbortException and handle it appropriately. We can log the error and maybe even retry the operation.

try { // Code that may cause the broken pipe // … } catch (ClientAbortException e) { // Log the error logger.error(“ClientAbortException occurred: “ + e.getMessage()); // Handle the exception gracefully (e.g., retry the operation) // … } It’s crucial to handle exceptions like this at the appropriate level of your application. In this case, the fix should be implemented in the doFlush method of the org.apache.catalina.connector.OutputBuffer class.

What Else Remember, Sentry can’t fix this broken pipe error, but it can help you identify and track such issues. By using Sentry, you can gain insights into the frequency and impact of these errors, allowing you to prioritize and tackle them accordingly.

So, go forth and fix that broken pipe, preventing your code from tripping over its own feet. And remember, when it comes to software errors, perseverance is key, even when faced with a broken pipe you’ll be able to survive!

  • https://lists.apache.org/thread/23opn4m8c3xw09rs0rvq6w2loho6r7sd
  • https://perfectacle.github.io/2022/03/20/client-abort-exception-deep-dive-part-02/
  • https://serverwizard.tistory.com/301
  • https://github.com/spring-projects/spring-framework/issues/32042
  • https://tech.joellemena.com/apache/org-apache-catalina-connector-clientabortexception-java-io-ioexception/
  • https://coderanch.com/t/86510/application-servers/catch-ClientAbortException-Tomcat-hosted-servlets
  • https://help.liferay.com/hc/en-us/articles/360034933391-ClientAbortException-is-thrown-while-navigating-from-one-page-to-another
  • https://forums.oracle.com/ords/r/apexds/community/q?question=clientabortexception-java-net-socketexception-connection-re-4289
  • https://stackoverflow.com/questions/51993008/how-to-handle-only-clientabortexception
  • https://support.pega.com/support-doc/troubleshooting-clientabortexception-and-unexpected-eof-exceptions
  • https://confluence.atlassian.com/jirakb/clientabortexception-errors-appear-in-jira-server-logs-225122378.html
  • https://users.tomcat.apache.narkive.com/Zl0VVoye/tomcat-6-0-32-clientabortexception-java-io-ioexception
  • https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408
This post is licensed under CC BY 4.0 by the author.