Skip to content
Snippets Groups Projects

Issue #3102739: Allow failing over to database or other backends if Redis is down

Open Issue #3102739: Allow failing over to database or other backends if Redis is down
4 unresolved threads
4 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
54 58 else {
55 59 $client = new Client($connectionInfo);
56 60 }
57 return $client;
58 61
62 try {
63 $client->connect();
64 }
65 catch (\Exception $e) {
66 if (Settings::get('redis.failover', FALSE)) {
67 watchdog_exception('redis', $e);
68 \Drupal::logger('redis')->critical('@client: Could not connect to Redis, using failover if available.', ['@client' => $this->getName()]);
  • 56 60 }
    57 return $client;
    58 61
    62 try {
    63 $client->connect();
    64 }
    65 catch (\Exception $e) {
    66 if (Settings::get('redis.failover', FALSE)) {
    67 watchdog_exception('redis', $e);
    68 \Drupal::logger('redis')->critical('@client: Could not connect to Redis, using failover if available.', ['@client' => $this->getName()]);
    69 return FALSE;
    70 }
    71
    72 // Log an alert here because very likely intervention will be needed if
    73 // Redis is down without a failover.
    74 \Drupal::logger('redis')->alert('@client: Could not connect to Redis.', ['@client' => $this->getName()]);
  • 28 if ($persistent) {
    29 $client->pconnect($host, $port);
    28 try {
    29 if ($persistent) {
    30 $client->pconnect($host, $port);
    31 }
    32 else {
    33 $client->connect($host, $port);
    34 }
    30 35 }
    31 else {
    32 $client->connect($host, $port);
    36 catch (\RedisException $e) {
    37 if (Settings::get('redis.failover', FALSE)) {
    38 watchdog_exception('redis', $e);
    39 \Drupal::logger('redis')->critical('@client: Could not connect to Redis, using failover if available.', ['@client' => $this->getName()]);
  • 32 else {
    33 $client->connect($host, $port);
    34 }
    30 35 }
    31 else {
    32 $client->connect($host, $port);
    36 catch (\RedisException $e) {
    37 if (Settings::get('redis.failover', FALSE)) {
    38 watchdog_exception('redis', $e);
    39 \Drupal::logger('redis')->critical('@client: Could not connect to Redis, using failover if available.', ['@client' => $this->getName()]);
    40 return FALSE;
    41 }
    42
    43 // Log an alert here because very likely intervention will be needed if
    44 // Redis is down without a failover.
    45 \Drupal::logger('redis')->alert('@client: Could not connect to Redis.', ['@client' => $this->getName()]);
    Please register or sign in to reply
    Loading