aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormelkov <melkov@yandex-team.com>2023-08-11 04:22:44 +0300
committermelkov <melkov@yandex-team.com>2023-08-11 05:11:23 +0300
commitd51343356504193b7cc73d7f5586aac2b220ec89 (patch)
tree8d9cb510621cdcbc1eae0078d77637058bfe9b91
parent4c557b059d6d53b6c8c65edd22a6148d33f4dbc8 (diff)
downloadydb-d51343356504193b7cc73d7f5586aac2b220ec89.tar.gz
Do not fail to initialize C++ job when user name is not provided in the system for the job's user id
* simply set the user name to 'u' + euid
-rw-r--r--yt/cpp/mapreduce/interface/config.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/yt/cpp/mapreduce/interface/config.cpp b/yt/cpp/mapreduce/interface/config.cpp
index b474dc0844..e159780ba9 100644
--- a/yt/cpp/mapreduce/interface/config.cpp
+++ b/yt/cpp/mapreduce/interface/config.cpp
@@ -283,7 +283,11 @@ TProcessState::TProcessState()
try {
UserName = ::GetUsername();
} catch (const yexception& e) {
+#ifdef _win_
ythrow yexception() << "Cannot get user name: " << e.what();
+#else
+ UserName = "u" + ToString(geteuid());
+#endif
}
Pid = static_cast<int>(getpid());