Skip to content

Conversation

@glyh
Copy link
Member

@glyh glyh commented Dec 14, 2025

This is inspired by #18247. It does NOT close it, because there seems to be some other issues stemming from Nori's observation.

Admitted this is a very ugly fix, in that we just wrap the error with 500 and error message as the body. However, to proper handle errors, it requires a lot of refactor, which I don't think we could afford now.

Status: waiting for review.

@glyh glyh requested a review from a team as a code owner December 14, 2025 11:23
@glyh glyh marked this pull request as draft December 14, 2025 12:36
@glyh glyh force-pushed the lyh/do-not-close-connection-on-graphql-query-error branch 2 times, most recently from e195ef0 to 1aac662 Compare December 14, 2025 14:31
| Ok doc ->
Schema.execute schema ctx ?variables ?operation_name doc
let open Async in
Monitor.try_with (fun () ->
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to use a Monitor.try_with because try .. with doesn't work with Async.

#18254

struct
module Ws = Websocket.Connection.Make (Io)
module Websocket_transport = Websocket_handler.Make (Schema.Io) (Ws)
module Make = struct
Copy link
Member Author

@glyh glyh Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be further refactored. But I think it'll be better for us to take ownership of the upstream library ocaml-graphql-server and patch there:

  1. This file is copy-pasted and modified by us from that lib;
  2. Nobody is maintaining that library at all.

I'd definitely save this for a follow up PR if ever.

module Make
(Schema : Graphql_intf.Schema)
(Io : Cohttp.S.IO with type 'a t = 'a Schema.Io.t)
(Body : HttpBody with type +'a io := 'a Schema.Io.t) =
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we used Monitor.protect within this functor, the abstraction doesn't work -- This implementation would only work for Async. Not any other libs like, say, Lwt.

@glyh glyh marked this pull request as ready for review December 14, 2025 14:36
@glyh glyh force-pushed the lyh/do-not-close-connection-on-graphql-query-error branch from 1aac662 to 6a10221 Compare December 14, 2025 14:38
@glyh
Copy link
Member Author

glyh commented Dec 14, 2025

!ci-docker-me codename=noble arch=amd64 profile=devnet

@glyh
Copy link
Member Author

glyh commented Dec 14, 2025

!ci-docker-me codename=noble arch=amd64 profile=mainnet

@glyh
Copy link
Member Author

glyh commented Dec 14, 2025

@glyh glyh requested a review from a team as a code owner December 15, 2025 09:41
@glyh glyh force-pushed the lyh/do-not-close-connection-on-graphql-query-error branch from f6dda49 to 32e5263 Compare December 15, 2025 09:52
@glyh glyh marked this pull request as draft December 15, 2025 09:52
@glyh glyh force-pushed the lyh/do-not-close-connection-on-graphql-query-error branch from 32e5263 to fc26c61 Compare December 15, 2025 13:02
@glyh
Copy link
Member Author

glyh commented Dec 15, 2025

!ci-build-me

@glyh glyh force-pushed the lyh/do-not-close-connection-on-graphql-query-error branch from fc26c61 to b121d9e Compare December 18, 2025 14:22
@glyh
Copy link
Member Author

glyh commented Dec 18, 2025

!ci-build-me

@glyh glyh marked this pull request as ready for review December 18, 2025 14:28
@glyh glyh requested a review from dkijania December 18, 2025 14:29
fi

# Check bestTip
BEST_TIP_STATE_HASH=$(curl -f --show-error 'http://localhost:3085/graphql' \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like everything before --data-raw is duplicated between the request. Please extract that part to some common string maybe?

Copy link
Member

@dkijania dkijania left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just on nit

done

# Check that the daemon has connected to peers and is still up after 2 mins
if [[ "$node_status" != "SYNCED" ]]; then
Copy link
Member Author

@glyh glyh Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're checking for node to synced instead of peers now

@glyh
Copy link
Member Author

glyh commented Dec 22, 2025

!ci-build-me

@glyh
Copy link
Member Author

glyh commented Dec 23, 2025

Should be ready for another round of review.

@glyh glyh merged commit f09adce into compatible Jan 5, 2026
66 checks passed
@glyh glyh deleted the lyh/do-not-close-connection-on-graphql-query-error branch January 5, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants