@514labs/moose-lib 0.6.260-ci-3-g63948580 → 0.6.260-ci-5-g3b5261dd

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,7 +83,17 @@ var init_commons = __esm({
83
83
  username,
84
84
  password,
85
85
  database,
86
- application: "moose"
86
+ application: "moose",
87
+ // Connection pool configuration for high load (100+ concurrent users)
88
+ max_open_connections: 50,
89
+ // Increased from default 10 to handle 100 concurrent users
90
+ request_timeout: 6e4,
91
+ // 60s timeout for HTTP requests (queries and inserts)
92
+ keep_alive: {
93
+ enabled: true,
94
+ idle_socket_ttl: 2e3
95
+ // 2s idle time (lower than default to prevent socket hang-ups)
96
+ }
87
97
  // Note: wait_end_of_query is configured per operation type, not globally
88
98
  // to preserve SELECT query performance while ensuring INSERT/DDL reliability
89
99
  });
@@ -469,7 +479,21 @@ async function getTemporalClient(temporalUrl, namespace, clientCert, clientKey,
469
479
  );
470
480
  let connectionOptions = {
471
481
  address: temporalUrl,
472
- connectTimeout: "3s"
482
+ connectTimeout: "30s",
483
+ // Increased from 3s to handle high load
484
+ // Add gRPC keepalive to prevent connection drops
485
+ channelArgs: {
486
+ "grpc.keepalive_time_ms": 3e4,
487
+ // Send keepalive every 30s
488
+ "grpc.keepalive_timeout_ms": 15e3,
489
+ // Wait 15s for keepalive response
490
+ "grpc.keepalive_permit_without_calls": 1,
491
+ // Allow keepalive without active calls
492
+ "grpc.http2.max_pings_without_data": 0,
493
+ // No limit on pings without data
494
+ "grpc.http2.min_time_between_pings_ms": 1e4
495
+ // Min 10s between pings
496
+ }
473
497
  };
474
498
  if (clientCert && clientKey) {
475
499
  console.log("Using TLS for secure Temporal");
@@ -2560,7 +2584,22 @@ async function createTemporalConnection(logger2, temporalConfig) {
2560
2584
  `<workflow> Using temporal_url: ${temporalConfig.url} and namespace: ${temporalConfig.namespace}`
2561
2585
  );
2562
2586
  let connectionOptions = {
2563
- address: temporalConfig.url
2587
+ address: temporalConfig.url,
2588
+ connectTimeout: 3e4,
2589
+ // 30s connection timeout
2590
+ // Add gRPC keepalive for worker stability
2591
+ channelArgs: {
2592
+ "grpc.keepalive_time_ms": 3e4,
2593
+ // Send keepalive every 30s
2594
+ "grpc.keepalive_timeout_ms": 15e3,
2595
+ // Wait 15s for keepalive response
2596
+ "grpc.keepalive_permit_without_calls": 1,
2597
+ // Allow keepalive without active calls
2598
+ "grpc.http2.max_pings_without_data": 0,
2599
+ // No limit on pings without data
2600
+ "grpc.http2.min_time_between_pings_ms": 1e4
2601
+ // Min 10s between pings
2602
+ }
2564
2603
  };
2565
2604
  if (temporalConfig.clientCert && temporalConfig.clientKey) {
2566
2605
  logger2.info("Using TLS for secure Temporal");