<commit_before>/*
Copyright (c) 2012-2014 The SSDB Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
*/
#include "server.h"
#include "../util/strings.h"
#include "../util/file.h"
#include "../util/config.h"
#include "../util/log.h"
#include "../util/ip_filter.h"
#include "link.h"
#include "fde.h"
#include <vector>
#include <execinfo.h>
#include <serv.h>

static DEF_PROC(ping);
static DEF_PROC(info);
static DEF_PROC(auth);


#define TICK_INTERVAL          100 // ms
#define STATUS_REPORT_TICKS    (300 * 1000/TICK_INTERVAL) // second
#define CURSOR_CLEANUP_TICKS    (60 * 1000/TICK_INTERVAL) // second

static const int TRANSFER_THREADS = 5;
static const int READER_THREADS = 10;
static const int WRITER_THREADS = 1;  // 必须为1, 因为某些写操作依赖单线程

volatile bool quit = false;
volatile uint32_t g_ticks = 0;


//void sig_signal_handler(int sig){
void sig_signal_handler(int sig, siginfo_t * info, void * ucontext) {
    ucontext_t *uc = (ucontext_t*) ucontext;
    log_error("SSDB %s crashed by signal: %d", SSDB_VERSION, sig);


    void *array[12];
    size_t size;

    // get void*'s for all entries on the stack
    size = backtrace(array, 12);

    // print out all the frames to stderr<commit_msg>crash info send to log<commit_after>/*
Copyright (c) 2012-2014 The SSDB Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
*/
#include "server.h"
#include "../util/strings.h"
#include "../util/file.h"
#include "../util/config.h"
#include "../util/log.h"
#include "../util/ip_filter.h"
#include "link.h"
#include "fde.h"
#include <vector>
#include <execinfo.h>
#include <serv.h>

static DEF_PROC(ping);
static DEF_PROC(info);
static DEF_PROC(auth);


#define TICK_INTERVAL          100 // ms
#define STATUS_REPORT_TICKS    (300 * 1000/TICK_INTERVAL) // second
#define CURSOR_CLEANUP_TICKS    (60 * 1000/TICK_INTERVAL) // second

static const int TRANSFER_THREADS = 5;
static const int READER_THREADS = 10;
static const int WRITER_THREADS = 1;  // 必须为1, 因为某些写操作依赖单线程

volatile bool quit = false;
volatile uint32_t g_ticks = 0;


//void sig_signal_handler(int sig){
void sig_signal_handler(int sig, siginfo_t * info, void * ucontext) {
    ucontext_t *uc = (ucontext_t*) ucontext;
    log_error("SSDB %s crashed by signal: %d", SSDB_VERSION, sig);


    void *array[12];
    int size;

    // get void*'s for all entries on the stack
    size = backtrace(array, 12);

    // print out all the frames to stderr
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.028125, 'mean_word_length': 3.7690875232774674, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4600437', 'n_tokens_mistral': 990, 'n_tokens_neox': 925, 'n_words': 283}