Skip to content

"Electric.ShapeCache.ShapeStatus.ShapeDb.Connection, :read" Time out #3729

@JZSang

Description

@JZSang

Versions

  • Client: @tanstack/db
  • Electric: latest (1.3.0)

Bug description

Running on ECS Fargate, 4 vCPU, 8 GB RAM, with EFS (elastic) and a Caddy cache/proxy in the same task. EFS has about 800 MB of data when we upgraded. And there were about maybe 10/20 tables being loaded at once when we pushed the new electric version on to staging.

On start up, Electric SQL starts bottlenecking on the code below (this log below will keep on firing and firing. Only a few tables can be loaded (most get a 503 Internal Server Error). We dug around and thought this pr could be the problem? But I don't know :^).

[error] ** (exit) exited in: NimblePool.checkout(
  {:via, Registry, {:"Electric.ProcessRegistry:single_stack",
   {Electric.ShapeCache.ShapeStatus.ShapeDb.Connection, :read}}}
)

** (EXIT) time out


(nimble_pool 1.1.0) lib/nimble_pool.ex:518: NimblePool.exit!/3
(electric 1.3.0) lib/electric/shape_cache/shape_status.ex:168:
  anonymous fn/3 in Electric.ShapeCache.ShapeStatus.validate_shape_handle/3
(opentelemetry 1.7.0)
  /builder/electric/deps/opentelemetry/src/otel_tracer_default.erl:47:
  :otel_tracer_default.with_span/5
(electric 1.3.0) lib/electric/telemetry/open_telemetry.ex:87:
  anonymous fn/5 in Electric.Telemetry.OpenTelemetry.do_with_span/5
(telemetry 1.3.0)
  /builder/electric/deps/telemetry/src/telemetry.erl:324: :telemetry.span/3
(electric 1.3.0) lib/electric/shape_cache.ex:85:
  Electric.ShapeCache.resolve_shape_handle/3
(electric 1.3.0) lib/electric/shapes/api.ex:268:
  anonymous fn/1 in Electric.Shapes.Api.load_shape_info/1
(opentelemetry 1.7.0)
  /builder/electric/deps/opentelemetry/src/otel_tracer_default.erl:47:
  :otel_tracer_default.with_span/5
(electric 1.3.0) lib/electric/telemetry/open_telemetry.ex:87:
  anonymous fn/5 in Electric.Telemetry.OpenTelemetry.do_with_span/5
(telemetry 1.3.0)
  /builder/electric/deps/telemetry/src/telemetry.erl:324: :telemetry.span/3
(electric 1.3.0) lib/electric/shapes/api.ex:180:
  Electric.Shapes.Api.validate/2
(electric 1.3.0) lib/electric/plug/serve_shape_plug.ex:49:
  Electric.Plug.ServeShapePlug.validate_request/2
(electric 1.3.0) lib/electric/plug/serve_shape_plug.ex:1:
  Electric.Plug.ServeShapePlug.plug_builder_call/2
(electric 1.3.0) deps/plug/lib/plug/error_handler.ex:80:
  Electric.Plug.ServeShapePlug.call/2
(electric 1.3.0) deps/plug/lib/plug/router.ex:246:
  anonymous fn/4 in Electric.Plug.Router.dispatch/2
(telemetry 1.3.0)
  /builder/electric/deps/telemetry/src/telemetry.erl:324: :telemetry.span/3
(electric 1.3.0) deps/plug/lib/plug/router.ex:242:
  Electric.Plug.Router.dispatch/2
(electric 1.3.0) lib/electric/plug/router.ex:1:
  Electric.Plug.Router.plug_builder_call/2
(electric 1.3.0) lib/electric/plug/router.ex:1:
  Electric.Plug.Router.call/2
(bandit 1.8.0) lib/bandit/pipeline.ex:131:
  Bandit.Pipeline.call_plug!/2
(bandit 1.8.0) lib/bandit/pipeline.ex:42:
  Bandit.Pipeline.run/5
(bandit 1.8.0) lib/bandit/http1/handler.ex:13:
  Bandit.HTTP1.Handler.handle_data/3
(bandit 1.8.0) lib/bandit/delegating_handler.ex:18:
  Bandit.DelegatingHandler.handle_data/3
(bandit 1.8.0) lib/bandit/delegating_handler.ex:8:
  Bandit.DelegatingHandler.handle_continue/2
(stdlib 7.1) gen_server.erl:2424:
  :gen_server.try_handle_continue/3
(stdlib 7.1) gen_server.erl:2291:
  :gen_server.loop/4
(stdlib 7.1) proc_lib.erl:333:
  :proc_lib.init_p_do_apply/3

Expected behavior
Tables should load seamlessly. We downgraded back to 1.2.11 and we now have no issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions