Skip to content

Commit

Permalink
Improved error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaSBrown committed Sep 5, 2023
1 parent 9e46b0f commit fb1e232
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions repository/gridftp/globus5/authz/source/AuthzWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class AuthzWorker {
DL_INFO(m_log_context,
"Creating client with adress to server: " << address);
AddressSplitter splitter(address);

SocketOptions socket_options;
socket_options.scheme = splitter.scheme();
socket_options.class_type = SocketClassType::CLIENT;
Expand All @@ -172,11 +173,18 @@ class AuthzWorker {
socket_options.connection_security = SocketConnectionSecurity::SECURE;
socket_options.host = splitter.host();
socket_options.port = splitter.port();

if ( socket_options.port.has_value() ) {
if( socket_options.port.value() != 7512 ) {
DL_WARNING(m_log_context,
"Port number is defined for: " << address << " however, it is a non standard port, the standard port for connecting to the core server is port number 7512, whereas here you are using port: " << socket_options.port.value());
}
}
// socket_options.port = 1341;
socket_options.local_id = socket_id;

uint32_t timeout_on_receive = 10000;
long timeout_on_poll = 10000;
uint32_t timeout_on_receive = 50000;
long timeout_on_poll = 50000;

CommunicatorFactory comm_factory(m_log_context);
// When creating a communication channel with a server application we need
Expand Down Expand Up @@ -216,8 +224,17 @@ class AuthzWorker {
log_context.correlation_id = std::get<std::string>(
response.message->get(MessageAttribute::CORRELATION_ID));
if (response.time_out) {
std::string error_msg = "AuthWorker.cpp Core service did not respond within timeout.";

AddressSplitter splitter(client->address());

if( splitter.port().value() != 7512 ) {

error_msg += "Port number is defined for: " + client->address() + " however, it is a non standard port, the standard port for connecting to the core server is port number 7512, whereas here you are using port: " + std::to_string( splitter.port().value());
}

DL_WARNING(log_context,
"AuthWorker.cpp Core service did not respond within timeout.");
error_msg);
EXCEPT(1, "Core service did not respond");
} else if (response.error) {
DL_ERROR(log_context, "AuthWorker.cpp there was an error when "
Expand Down Expand Up @@ -278,6 +295,7 @@ const char *getReleaseVersion() {
int checkAuthorization(char *client_id, char *object, char *action,
struct Config *config) {
SDMS::global_logger.setSysLog(true);
SDMS::global_logger.setLevel(SDMS::LogLevel::TRACE);
SDMS::global_logger.addStream(std::cerr);

SDMS::LogContext log_context;
Expand Down

0 comments on commit fb1e232

Please sign in to comment.