add missing deadlock detection
This commit is contained in:
parent
7dcadc1ca2
commit
d3f88a8acd
6 changed files with 9 additions and 7 deletions
|
|
@ -355,6 +355,7 @@ class SimOutputArtifact: public Artifact {
|
|||
*/
|
||||
inline long get_size() override { if (has_content_) {return sim_log.size();} else {return size_;} };
|
||||
inline void set_size(long size) { if (!has_content_) this->size_ = size; };
|
||||
inline void fix_size() { this->size_ = sim_log.size();};
|
||||
|
||||
const bool& fault_timing_deviation = fault_timing_deviation_;
|
||||
const bool& fault_value = fault_value_;
|
||||
|
|
|
|||
|
|
@ -287,14 +287,14 @@ std::shared_ptr<pl::SimOutputArtifact> Downloader::fetch_reference_run(const db:
|
|||
bool *found
|
||||
) {
|
||||
try {
|
||||
auto res = txn->exec("SELECT output_tokens, output_token_timings FROM sim_outputs WHERE sim_config = $1;", id)[0];
|
||||
auto res = txn->exec("SELECT output_tokens, output_token_timings, log_size FROM sim_outputs WHERE sim_config = $1;", id)[0];
|
||||
|
||||
// load the output token timings
|
||||
auto arr_ott = res["output_token_timings"].as_sql_array<uint32_t>();
|
||||
*output_token_timings = std::vector<uint32_t>(arr_ott.cbegin(), arr_ott.cend());
|
||||
|
||||
*output_tokens = res["output_tokens"].as<long>();
|
||||
*log_size = 0;
|
||||
*log_size = res["log_size"].as<long>();
|
||||
|
||||
*found = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
**************************************************************************
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include "../../include/cluster/artifact.hpp"
|
||||
#include <regex>
|
||||
#include "util.h"
|
||||
#include "log_parser.hpp"
|
||||
|
|
@ -60,7 +60,7 @@ void LogParser::parse_log(const std::string& line) {
|
|||
// check for glitch
|
||||
check_glitch(line);
|
||||
|
||||
//this->artifact->add_log_output(line);
|
||||
this->artifact->add_log_output(line);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -77,6 +77,7 @@ void LogParser::parse_error([[maybe_unused]]const std::string& line) {
|
|||
|
||||
void LogParser::finalize() {
|
||||
|
||||
this->artifact->fix_size();
|
||||
this->artifact->clear_logs();
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
*/
|
||||
|
||||
#include "util.h"
|
||||
#include <chrono>
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <thread>
|
||||
|
|
|
|||
|
|
@ -126,10 +126,10 @@ bool Uploader::upload_task(std::vector<std::unique_ptr<OutputType>>& tasks) {
|
|||
|
||||
auto upload_results_lambda = [] (pqxx::work* txn, std::vector<std::unique_ptr<OutputType>>* tasks) {
|
||||
|
||||
pqxx::stream_to stream = pqxx::stream_to::table(*txn, {"sim_outputs"}, {"artifact","source_pass", "sim_config", "output_tokens", "output_token_timings", "fault_flags", "part_status"});
|
||||
pqxx::stream_to stream = pqxx::stream_to::table(*txn, {"sim_outputs"}, {"artifact","source_pass", "sim_config", "output_tokens", "output_token_timings", "fault_flags", "log_size", "part_status"});
|
||||
|
||||
for (auto&& task : (*tasks)) {
|
||||
stream.write_values(task->target_artifact, task->source_pass, task->source_config, task->output_tokens, task->get_output_token_timings(), build_fault_flags(task), "finished");
|
||||
stream.write_values(task->target_artifact, task->source_pass, task->source_config, task->output_tokens, task->get_output_token_timings(), build_fault_flags(task), task->get_size(), "finished");
|
||||
}
|
||||
|
||||
stream.complete();
|
||||
|
|
|
|||
|
|
@ -519,6 +519,7 @@ std::unique_ptr<OutputType> Worker::perform_task(std::unique_ptr<InputType>& tas
|
|||
finished = true;
|
||||
kill(pid, SIGKILL);
|
||||
break;
|
||||
std::cout << "Killing deadlocked sim" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue