Skip to content

Commit a69a070

Browse files
committed
Revert "WorkerSettings: Add disableLiburing option"
This reverts commit 0799e37.
1 parent 62f0bf4 commit a69a070

File tree

5 files changed

+8
-41
lines changed

5 files changed

+8
-41
lines changed

node/src/Worker.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ export type WorkerSettings<WorkerAppData extends AppData = AppData> = {
8383
*/
8484
libwebrtcFieldTrials?: string;
8585

86-
/**
87-
* Disable liburing (io_uring) despite it's supported in current host.
88-
*/
89-
disableLiburing?: boolean;
90-
9186
/**
9287
* Custom application data.
9388
*/
@@ -292,7 +287,6 @@ export class Worker<
292287
dtlsCertificateFile,
293288
dtlsPrivateKeyFile,
294289
libwebrtcFieldTrials,
295-
disableLiburing,
296290
appData,
297291
}: WorkerSettings<WorkerAppData>) {
298292
super();
@@ -344,10 +338,6 @@ export class Worker<
344338
spawnArgs.push(`--libwebrtcFieldTrials=${libwebrtcFieldTrials}`);
345339
}
346340

347-
if (disableLiburing) {
348-
spawnArgs.push(`--disableLiburing`);
349-
}
350-
351341
logger.debug(
352342
'spawning worker process: %s %s',
353343
spawnBin,

rust/src/worker.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ pub struct WorkerSettings {
192192
/// "WebRTC-Bwe-AlrLimitedBackoff/Enabled/".
193193
#[doc(hidden)]
194194
pub libwebrtc_field_trials: Option<String>,
195-
/// Disable liburing (io_uring) despite it's supported in current host.
196-
pub disable_liburing: Option<bool>,
197195
/// Function that will be called under worker thread before worker starts, can be used for
198196
/// pinning worker threads to CPU cores.
199197
pub thread_initializer: Option<Arc<dyn Fn() + Send + Sync>>,
@@ -223,7 +221,6 @@ impl Default for WorkerSettings {
223221
rtc_port_range: 10000..=59999,
224222
dtls_files: None,
225223
libwebrtc_field_trials: None,
226-
disable_liburing: None,
227224
thread_initializer: None,
228225
app_data: AppData::default(),
229226
}
@@ -238,7 +235,6 @@ impl fmt::Debug for WorkerSettings {
238235
rtc_port_range,
239236
dtls_files,
240237
libwebrtc_field_trials,
241-
disable_liburing,
242238
thread_initializer,
243239
app_data,
244240
} = self;
@@ -249,7 +245,6 @@ impl fmt::Debug for WorkerSettings {
249245
.field("rtc_port_range", &rtc_port_range)
250246
.field("dtls_files", &dtls_files)
251247
.field("libwebrtc_field_trials", &libwebrtc_field_trials)
252-
.field("disable_liburing", &disable_liburing)
253248
.field(
254249
"thread_initializer",
255250
&thread_initializer.as_ref().map(|_| "ThreadInitializer"),
@@ -361,7 +356,6 @@ impl Inner {
361356
rtc_port_range,
362357
dtls_files,
363358
libwebrtc_field_trials,
364-
disable_liburing,
365359
thread_initializer,
366360
app_data,
367361
}: WorkerSettings,
@@ -410,10 +404,6 @@ impl Inner {
410404
));
411405
}
412406

413-
if let Some(disable_liburing) = disable_liburing {
414-
spawn_args.push(format!("--disable_liburing"));
415-
}
416-
417407
let id = WorkerId::new();
418408
debug!(
419409
"spawning worker with arguments [id:{}]: {}",

worker/include/Settings.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class Settings
3939
std::string dtlsCertificateFile;
4040
std::string dtlsPrivateKeyFile;
4141
std::string libwebrtcFieldTrials{ "WebRTC-Bwe-AlrLimitedBackoff/Enabled/" };
42-
bool liburingDisabled{ false };
4342
};
4443

4544
public:

worker/src/DepLibUring.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
#include "DepLibUring.hpp"
55
#include "Logger.hpp"
66
#include "MediaSoupErrors.hpp"
7-
#include "Settings.hpp"
87
#include "Utils.hpp"
98
#include <sys/eventfd.h>
109
#include <sys/resource.h>
1110
#include <sys/utsname.h>
1211

1312
/* Static variables. */
1413
bool DepLibUring::enabled{ false };
15-
// liburing instance per thread.
14+
/* liburing instance per thread. */
1615
thread_local DepLibUring::LibUring* DepLibUring::liburing{ nullptr };
17-
// Completion queue entry array used to retrieve processes tasks.
16+
/* Completion queue entry array used to retrieve processes tasks. */
1817
thread_local struct io_uring_cqe* cqes[DepLibUring::QueueDepth];
1918

2019
/* Static methods for UV callbacks. */
@@ -122,13 +121,6 @@ void DepLibUring::ClassInit()
122121

123122
MS_DEBUG_TAG(info, "liburing version: \"%i.%i\"", mayor, minor);
124123

125-
if (Settings::configuration.liburingDisabled)
126-
{
127-
MS_DEBUG_TAG(info, "liburing disabled by user settings");
128-
129-
return;
130-
}
131-
132124
// This must be called first.
133125
DepLibUring::CheckRuntimeSupport();
134126

worker/src/Settings.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ void Settings::SetConfiguration(int argc, char* argv[])
6060
{ "dtlsCertificateFile", optional_argument, nullptr, 'c' },
6161
{ "dtlsPrivateKeyFile", optional_argument, nullptr, 'p' },
6262
{ "libwebrtcFieldTrials", optional_argument, nullptr, 'W' },
63-
{ "disableLiburing", no_argument, nullptr, 'd' },
64-
{ nullptr, 0, nullptr, 0 }
63+
{ nullptr, 0, nullptr, 0 }
6564
};
6665
// clang-format on
6766
std::string stringValue;
@@ -74,9 +73,13 @@ void Settings::SetConfiguration(int argc, char* argv[])
7473

7574
optind = 1; // Set explicitly, otherwise subsequent runs will fail.
7675
opterr = 0; // Don't allow getopt to print error messages.
77-
7876
while ((c = getopt_long_only(argc, argv, "", options, &optionIdx)) != -1)
7977
{
78+
if (!optarg)
79+
{
80+
MS_THROW_TYPE_ERROR("unknown configuration parameter: %s", optarg);
81+
}
82+
8083
switch (c)
8184
{
8285
case 'l':
@@ -155,13 +158,6 @@ void Settings::SetConfiguration(int argc, char* argv[])
155158
break;
156159
}
157160

158-
case 'd':
159-
{
160-
Settings::configuration.liburingDisabled = true;
161-
162-
break;
163-
}
164-
165161
// Invalid option.
166162
case '?':
167163
{

0 commit comments

Comments
 (0)