Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
1bd3637f
"packaging/vscode:/vscode.git/clone" did not exist on "a78d0d83d0a499fe8480d7a9f493676e746c4699"
Unverified
Commit
1bd3637f
authored
Jun 24, 2019
by
SparkSnail
Committed by
GitHub
Jun 24, 2019
Browse files
Fix EMFILE error in local training service (#1189)
parent
26792dfb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
src/nni_manager/training_service/local/localTrainingService.ts
...ni_manager/training_service/local/localTrainingService.ts
+5
-3
src/nni_manager/types/tail-stream/index.d.ts
src/nni_manager/types/tail-stream/index.d.ts
+2
-1
No files found.
src/nni_manager/training_service/local/localTrainingService.ts
View file @
1bd3637f
...
@@ -355,7 +355,8 @@ class LocalTrainingService implements TrainingService {
...
@@ -355,7 +355,8 @@ class LocalTrainingService implements TrainingService {
this
.
log
.
info
(
'
Stopping local machine training service...
'
);
this
.
log
.
info
(
'
Stopping local machine training service...
'
);
this
.
stopping
=
true
;
this
.
stopping
=
true
;
for
(
const
stream
of
this
.
jobStreamMap
.
values
())
{
for
(
const
stream
of
this
.
jobStreamMap
.
values
())
{
stream
.
destroy
();
stream
.
end
(
0
)
stream
.
emit
(
'
end
'
)
}
}
if
(
this
.
gpuScheduler
!==
undefined
)
{
if
(
this
.
gpuScheduler
!==
undefined
)
{
await
this
.
gpuScheduler
.
stop
();
await
this
.
gpuScheduler
.
stop
();
...
@@ -372,7 +373,9 @@ class LocalTrainingService implements TrainingService {
...
@@ -372,7 +373,9 @@ class LocalTrainingService implements TrainingService {
if
(
stream
===
undefined
)
{
if
(
stream
===
undefined
)
{
throw
new
Error
(
`Could not find stream in trial
${
trialJob
.
id
}
`
);
throw
new
Error
(
`Could not find stream in trial
${
trialJob
.
id
}
`
);
}
}
stream
.
destroy
();
//Refer https://github.com/Juul/tail-stream/issues/20
stream
.
end
(
0
)
stream
.
emit
(
'
end
'
)
this
.
jobStreamMap
.
delete
(
trialJob
.
id
);
this
.
jobStreamMap
.
delete
(
trialJob
.
id
);
}
}
}
}
...
@@ -567,7 +570,6 @@ class LocalTrainingService implements TrainingService {
...
@@ -567,7 +570,6 @@ class LocalTrainingService implements TrainingService {
buffer
=
remain
;
buffer
=
remain
;
}
}
});
});
this
.
jobStreamMap
.
set
(
trialJobDetail
.
id
,
stream
);
this
.
jobStreamMap
.
set
(
trialJobDetail
.
id
,
stream
);
}
}
...
...
src/nni_manager/types/tail-stream/index.d.ts
View file @
1bd3637f
declare
module
'
tail-stream
'
{
declare
module
'
tail-stream
'
{
export
interface
Stream
{
export
interface
Stream
{
on
(
type
:
'
data
'
,
callback
:
(
data
:
Buffer
)
=>
void
):
void
;
on
(
type
:
'
data
'
,
callback
:
(
data
:
Buffer
)
=>
void
):
void
;
destroy
():
void
;
end
(
data
:
number
):
void
;
emit
(
data
:
string
):
void
;
}
}
export
function
createReadStream
(
path
:
string
):
Stream
;
export
function
createReadStream
(
path
:
string
):
Stream
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment