{"id":27069443,"url":"https://github.com/const/pg-json-uuid-bug","last_synced_at":"2026-04-19T07:34:25.243Z","repository":{"id":285351030,"uuid":"957737446","full_name":"const/pg-json-uuid-bug","owner":"const","description":"Application that reproduce the specific bug in postgresql related to handling UUIDs in JSON","archived":false,"fork":false,"pushed_at":"2025-05-15T00:53:05.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T09:25:41.071Z","etag":null,"topics":["bug","java","postgres","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/const.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-31T03:19:28.000Z","updated_at":"2025-05-15T00:53:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"1660335a-616c-4a18-a532-9f1b582f161e","html_url":"https://github.com/const/pg-json-uuid-bug","commit_stats":null,"previous_names":["const/pg-json-uuid-bug"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/const/pg-json-uuid-bug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/const%2Fpg-json-uuid-bug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/const%2Fpg-json-uuid-bug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/const%2Fpg-json-uuid-bug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/const%2Fpg-json-uuid-bug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/const","download_url":"https://codeload.github.com/const/pg-json-uuid-bug/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/const%2Fpg-json-uuid-bug/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31999039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bug","java","postgres","postgresql"],"created_at":"2025-04-05T21:32:34.730Z","updated_at":"2026-04-19T07:34:25.225Z","avatar_url":"https://github.com/const.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= PostgreSQL JSON + UUID invalid data bug reproduction application\n:toc:\n\n[IMPORTANT]\n====\nThe bug stopped to be reproduced after  Microcode Update from 115 to 12C (for Intel Core i9-13900K). So the case could be considered closed and the cause is CPU. However, it is not clear why there were no other symptoms except for UUID corruption. I have not tried intermediate versions of microcode updates, so I'm unable to pin down specific version that fixed the bug.\n====\n\nThe program is a short version of the performance test, so it has somewhat complicated structure. It does the following:\n\n* Fills database with some data\n* Executes a lot of queries that load hierarchical json\n* Parses JSON with jackson ObjectMapper\n\nThe expected result is that the program works correctly and there is no errors.\n\nThe actual result that sometimes json contains invalid UUIDs that are truncated or bigger than expected. ObjectMapper fails to convert it to DTO because UUIDS are in incorrect format.\n\nThis is a critical problem because database silently returns incorrect results and the problem is detected only because of additional validation in JSON consumer. The problem happens when database is highly loaded.\n\nIt is not completely clear whether this is database bug, compiler bug, CPU bug, docker bug, or interaction of some bugs. The primary suspect is database (or incorrect compiler options for database).\n\nNOTE: the application detects bug related to UUIDs, there might be outer bugs related to high load, but the program does not detect them.\n\n== Starting database\n\nThe database is started using docker compose:\n\n[source]\n----\ncd src/main/docker/bug-db\ndocker compose up\n----\n\nOr in background mode:\n\n[source]\n----\ncd src/main/docker/bug-db\ndocker compose up -d\n----\n\nAfter finishing testing, remove leftover data and containers:\n\n[source]\n----\ncd src/main/docker/bug-db\ndocker compose down -v\n----\n\nThe database starts on the port 5437. If this needs to be changed, modify the following files:\n\n* link:src/main/docker/bug-db/docker-compose.yml[]\n* link:src/main/resources/application.yml[]\n\n== Running from IDEA\n\n1. Open project as `pom.xml` in the root project directory.\n2. Load maven dependencies\n3. Start link:src/main/java/sample/Main.java[] file\n\n== Test results\n\nOn the first run, the program creates sample database and fills it with initial data. On subsequent runs, program re-executes create script and inserts records, if table `company` is empty.\n\nOn each start it creates directory with name like `target\\failures\\2025-03-31T01-48-45Z`. The directory name is written in log like:\n\n[source]\n----\n2025-03-31T04:48:45.173+03:00  INFO 30316 --- [           main] sample.test.TestServiceImpl              : Saving results of test in the directory: D:\\projects\\articles\\pg-json-bug\\target\\failures\\2025-03-31T01-48-45Z\n----\n\nThe program runs 7 minutes by default, it used 40 threads, and batch size 10000. Test run time, thread count and batch size are important for reproduction, if these parameters are reduced bug appearance becomes rarer or bug stops to reproduce. If bug does not appear, it might sense to try increasing these parameters.\n\nThe program detects failures often, but not always, sometimes 1-2 failures were detected per run, sometimes hundreds. If there were failures, the log will contain the line:\n\n[source]\n----\n2025-03-31T04:51:46.259+03:00  INFO 30316 --- [           main] sample.test.TestServiceImpl              : Run 5290 operations, detected 1 failure(s)\n----\n\nIf failures detected, it writers two files like the following for each failure:\n\n* `target/failures/2025-03-31T01-48-45Z/000000077.log` - exception stack trace for failure\n* `target/failures/2025-03-31T01-48-45Z/000000077.json` - json as string returned from the database (not present if json was not loaded)\n\n\nThe log file contains exceptions like:\n\n[source]\n----\nCaused by: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.util.UUID` from String \"0195e993-10\": UUID has to be represented by standard 36-char representation\n at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 6179664] (through reference chain: java.util.ArrayList[5127]-\u003esample.dto.CompanyDto[\"contactPersons\"]-\u003ejava.util.ArrayList[1]-\u003esample.dto.ContactPersonDto[\"id\"])\n\tat com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67)\n\tat com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1959)\n\tat com.fasterxml.jackson.databind.DeserializationContext.handleWeirdStringValue(DeserializationContext.java:1245)\n\tat com.fasterxml.jackson.databind.deser.std.UUIDDeserializer._badFormat(UUIDDeserializer.java:92)\n\tat com.fasterxml.jackson.databind.deser.std.UUIDDeserializer._deserialize(UUIDDeserializer.java:56)\n----\n\nAfter that the corresponding JSON file could be verified. One needs to search for invalid uuid in the quoted form like `\"0195e993-10\"`. The fragment like the following will be found;\n\n[source, json]\n----\n{\n  \"id\": \"0195e993-10a2-7525-8f8c-d03fecf6fb02\",\n  \"name\": \"Klocko-Schmeler R15323\",\n  \"industry\": \"International Trade and Development\",\n  \"description\": \"User-friendly holistic application\",\n  \"url\": \"https://www.gretta-conroy.io/?illum=vel\u0026officia=similique\",\n  \"verified\": null,\n  \"contactPersons\": [\n    {\n      \"id\": \"0195e993-10a2-7a24-b19d-098189e7a279\",\n      \"name\": \"Mrs. Edwardo Weimann\",\n      \"position\": \"Producer\",\n      \"details\": [\n        {\n          \"type\": \"TELEGRAM\",\n          \"value\": \"@pok.metz15323\"\n        }\n      ]\n    },\n    {\n      \"id\": \"0195e993-10\",\n      \"name\": \"Ms. Deeann Hane\",\n      \"position\": \"Agent\",\n      \"details\": [\n        {\n          \"type\": \"PHONE\",\n          \"value\": \"(505) 488-5164\"\n        }\n      ]\n    }\n  ],\n  \"offices\": [\n    {\n      \"id\": \"0195e993-10a2-759c-ad50-29705dbbbdb9\",\n      \"name\": \"Sally Forth\",\n      \"city\": \"Oberbrunnershire\",\n      \"address\": \"1892 Rosaura Tunnel, Cristton, CT 22683\"\n    }\n  ]\n}\n----\n\nAfter that it is possible to check if there is such record in the database using parent:\n\n[source, sql]\n----\nselect * from contact_person\nwhere company_id = '0195e993-10a2-7525-8f8c-d03fecf6fb02'\n----\n\nThere is a similar record, but with correct uuid, usually they are truncated, but sometimes I saw larger than normal in original program, but not in the test results.\n\nIncorrect UUID locations could be found by regexps:\n\n[source]\n----\n// raw PG json\n\"id\" : \"(?![a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\")\n\n// JSON formatted in IDEA\n\"id\": \"(?![a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\")\n----\n\nThe corrupted uuids come in different form:\n\n* `0195e993-10a2-7525-8f8c-d03fecf6fb02` - correct uuid\n* `0195e993-0f37-7ba3-a76c-95070715dc`\n* `0195e993-10` - truncated\n* `0195e993-11e8-75f7-9dd4-` - truncated on `-` (error was: `Can only construct UUIDs from byte[16]; got 18 bytes`)\n\n\n== Environment\n\nThe bug was detected on the following environment:\n\nOS: Windows 10 Pro (22H2 19045.5011),\n\nCPU: 13th Gen Intel(R) Core(TM) i9-13900K   3.00 GHz\n\nMemory: 128G\n\nDocker Engine v27.5.1\n\nWSL `uname -a`: `Linux docker-desktop 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 Linux`\n\nPostgreSQL: `PostgreSQL 17.4 (Debian 17.4-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit`\n\ncontainer: postgres:17.4\n\nPG JDBC: 42.7.5\n\n== Appendix 1: Unique bug\n\nI have once seen the following error:\n\n[source]\n----\norg.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [with company_data as (\n    select\n        json_build_object(\n            'id', c.company_id,\n            'name', c.\"name\",\n            'industry', c.industry,\n            'description', c.description,\n            'url', c.url,\n            'verified', (\n                select\n                    json_build_object(\n                        'timestamp', vi.\"timestamp\",\n                        'status', vi.status,\n                        'comment', vi.\"comment\",\n                        'user', vi.username\n                    )\n                from verification_info vi where vi.company_id = c.company_id\n            ),\n            'contactPersons', (\n                select\n                    coalesce(json_agg(\n                        json_build_object(\n                            'id', cp.contact_person_id,\n                            'name', cp.name,\n                            'position', cp.position,\n                            'details', (\n                                select\n                                    coalesce(json_agg(\n                                        json_build_object(\n                                            'type', cd.contact_type,\n                                            'value', cd.value\n                                        )\n                                    ), json_build_array())\n                                from contact_detail cd\n                                where cd.contact_person_id = cp.contact_person_id\n                            )\n                        )\n                    ), json_build_array())\n                from contact_person cp\n                where cp.company_id = c.company_id\n            ),\n            'offices', (\n                select\n                    coalesce(json_agg(\n                        json_build_object(\n                            'id', co.office_id,\n                            'name', co.name,\n                            'city', co.city,\n                            'address', co.address\n                        )\n                    ), json_build_array())\n                from company_office co\n                where co.company_id = c.company_id\n            )\n        ) as company_dto\n    from company c where c.company_id = any(?)\n)\nselect coalesce(json_agg(company_dto), json_build_array()) from company_data;\n]; ERROR: invalid input syntax for type uuid: \"0195e993-108d-7137-a756-3decf2861d9e\"\n  Где: unnamed portal parameter $1 = '...'\n\tat org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:118)\n\tat org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:107)\n\tat org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:116)\n\tat org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1556)\n\tat org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:677)\n\tat org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:723)\n\tat org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:754)\n\tat org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:773)\n\tat sample.test.TestServiceImpl.lambda$runTest$7(TestServiceImpl.java:145)\n\tat org.springframework.transaction.support.TransactionOperations.lambda$executeWithoutResult$0(TransactionOperations.java:68)\n\tat org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)\n\tat org.springframework.transaction.support.TransactionOperations.executeWithoutResult(TransactionOperations.java:67)\n\tat sample.test.TestServiceImpl.runTest(TestServiceImpl.java:144)\n\tat sample.test.TestServiceImpl.lambda$test$2(TestServiceImpl.java:125)\n\tat java.base/java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1804)\n\tat java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java)\n\tat --- Async.Stack.Trace --- (captured by IntelliJ IDEA debugger)\n\tat java.base/java.util.concurrent.CompletableFuture$AsyncRun.\u003cinit\u003e(CompletableFuture.java:1790)\n\tat java.base/java.util.concurrent.CompletableFuture.asyncRunStage(CompletableFuture.java:1818)\n\tat java.base/java.util.concurrent.CompletableFuture.runAsync(CompletableFuture.java:2018)\n\tat sample.test.TestServiceImpl.lambda$test$3(TestServiceImpl.java:125)\n\tat java.base/java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180)\n\tat java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104)\n\tat java.base/java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:712)\n\tat java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)\n\tat java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)\n\tat java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)\n\tat java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)\n\tat java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)\n\tat sample.test.TestServiceImpl.test(TestServiceImpl.java:126)\n\tat sample.Main.run(Main.java:28)\n\tat org.springframework.boot.SpringApplication.lambda$callRunner$5(SpringApplication.java:788)\n\tat org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:82)\n\tat org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60)\n\tat org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:86)\n\tat org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:796)\n\tat org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:787)\n\tat org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:772)\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)\n\tat java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)\n\tat java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510)\n\tat java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)\n\tat java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)\n\tat java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\n\tat java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)\n\tat org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:772)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:325)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1361)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1350)\n\tat sample.Main.main(Main.java:22)\nCaused by: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type uuid: \"0195e993-108d-7137-a756-3decf2861d9e\"\n  Где: unnamed portal parameter $1 = '...'\n\tat org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2733)\n\tat org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2420)\n\tat org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)\n\tat org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:517)\n\tat org.postgresql.jdbc.PgStatement.execute(PgStatement.java:434)\n\tat org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:194)\n\tat org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:137)\n\tat com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)\n\tat com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)\n\tat org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:732)\n\tat org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:658)\n\t... 46 more\n----\n\nIt seems the corruption might happen for input parameters as well. The following query worked correctly:\n\n[source]\n----\nselect * from company\nwhere company_id = '0195e993-108d-7137-a756-3decf2861d9e'\n----\n\nSo the problem was not related to actually incorrect UUID as written in error, there was internal error that cased wrongly reported UUID.\n\n== Appendix 2: Application does not exit\n\nSometimes PG does not return from `executeQuery()`.\n\nCurrently, there is the following line in link:src/main/resources/application.yml[]\n[source, yml]\n----\n    url: jdbc:postgresql://localhost:5437/bug_sample?Application_Name=sample\u0026socketTimeout=15\n----\n\nThis line causes the following messages in the log:\n\n[source]\n----\n2025-03-31T18:52:32.753+03:00  WARN 17928 --- [      Thread-27] com.zaxxer.hikari.pool.ProxyConnection   : postgresConnectionPool - Connection org.postgresql.jdbc.PgConnection@3ba65cca marked as broken because of SQLSTATE(08006), ErrorCode(0)\n\norg.postgresql.util.PSQLException: Ошибка ввода/вывода при отправке бэкенду\n\tat org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:399) ~[postgresql-42.7.5.jar:42.7.5]\n\tat org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:517) ~[postgresql-42.7.5.jar:42.7.5]\n\tat org.postgresql.jdbc.PgStatement.execute(PgStatement.java:434) ~[postgresql-42.7.5.jar:42.7.5]\n\tat org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:194) ~[postgresql-42.7.5.jar:42.7.5]\n\tat org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:137) ~[postgresql-42.7.5.jar:42.7.5]\n\tat com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[HikariCP-5.1.0.jar:na]\n\tat com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[HikariCP-5.1.0.jar:na]\n\n...\n\n2025-03-31T18:52:32.760+03:00 ERROR 17928 --- [      Thread-27] o.s.t.support.TransactionTemplate        : Application exception overridden by rollback exception\n\norg.springframework.dao.DataAccessResourceFailureException: PreparedStatementCallback; SQL [with company_data as (\n\n...\n----\n\nIf you replace it with:\n\n[source, yml]\n----\n    url: jdbc:postgresql://localhost:5437/bug_sample?Application_Name=sample\u0026socketTimeout=15\n----\n\nThe application will lock instead and there is the thread like the following if you take thread dump:\n\n[source]\n----\n\"Thread-1\" #66 [40320] prio=5 os_prio=0 cpu=16812.50ms elapsed=474.93s tid=0x000002471f5b68d0 nid=40320 runnable  [0x0000004fe9efe000]\n   java.lang.Thread.State: RUNNABLE\n\tat sun.nio.ch.Net.poll(java.base@21/Native Method)\n\tat sun.nio.ch.NioSocketImpl.park(java.base@21/NioSocketImpl.java:191)\n\tat sun.nio.ch.NioSocketImpl.park(java.base@21/NioSocketImpl.java:201)\n\tat sun.nio.ch.NioSocketImpl.implRead(java.base@21/NioSocketImpl.java:309)\n\tat sun.nio.ch.NioSocketImpl.read(java.base@21/NioSocketImpl.java:346)\n\tat sun.nio.ch.NioSocketImpl$1.read(java.base@21/NioSocketImpl.java:796)\n\tat java.net.Socket$SocketInputStream.read(java.base@21/Socket.java:1099)\n\tat org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:192)\n\tat org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:159)\n\tat org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:144)\n\tat org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:76)\n\tat org.postgresql.core.PGStream.receiveChar(PGStream.java:476)\n\tat org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2174)\n\tat org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)\n\tat org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:517)\n\tat org.postgresql.jdbc.PgStatement.execute(PgStatement.java:434)\n\tat org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:194)\n\tat org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:137)\n\tat com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)\n\tat com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)\n\tat org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:732)\n\tat org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:658)\n\tat org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:723)\n\tat org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:754)\n\tat org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:773)\n\tat sample.test.TestServiceImpl.lambda$runTest$5(TestServiceImpl.java:150)\n\tat sample.test.TestServiceImpl$$Lambda/0x00000246d7330890.accept(Unknown Source)\n\tat org.springframework.transaction.support.TransactionOperations.lambda$executeWithoutResult$0(TransactionOperations.java:68)\n\tat org.springframework.transaction.support.TransactionOperations$$Lambda/0x00000246d732d758.doInTransaction(Unknown Source)\n\tat org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)\n\tat org.springframework.transaction.support.TransactionOperations.executeWithoutResult(TransactionOperations.java:67)\n\tat sample.test.TestServiceImpl.runTest(TestServiceImpl.java:149)\n\tat sample.test.TestServiceImpl.lambda$test$2(TestServiceImpl.java:127)\n\tat sample.test.TestServiceImpl$$Lambda/0x00000246d7329b30.run(Unknown Source)\n\tat java.lang.Thread.runWith(java.base@21/Thread.java:1596)\n\tat java.lang.Thread.run(java.base@21/Thread.java:1583)\n----\n\nIn this case the last log message is the following (and CPU usage drops to almost 0):\n\n[source]\n----\n2025-03-31T13:11:56.007+03:00  INFO 42852 --- [           main] sample.test.TestServiceImpl              : Found 30000 companies\n----\n\nIn that case just kill program, json and log files are likely generated anyway around that problem.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconst%2Fpg-json-uuid-bug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconst%2Fpg-json-uuid-bug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconst%2Fpg-json-uuid-bug/lists"}