-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #2961: Output of short-lived tasks is not shown #9409
Conversation
@@ -103,8 +103,14 @@ export class TerminalProcess extends Process { | |||
// be ignored. | |||
if (signal === undefined || signal === 0) { | |||
this.emitOnExit(code, undefined); | |||
this.onProcessExited(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More info on exit
event ant its params you can find here
// Get the list of all available running tasks. | ||
const runningTasks: TaskInfo[] = await this.getRunningTasks(); | ||
// Get the corresponding task information based on task id if available. | ||
const taskInfo: TaskInfo | undefined = runningTasks.find((t: TaskInfo) => t.taskId === taskId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In short lived tasks- the task finishes before attached, But still needed to be attached...
@simark @marechal-p @vince-fugnitto @akosyakov or any reviewer? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be working for me with both tasks that conclude successfully (echo hello
) and those that error out (ls /non-existent-folder
), and I believe it addresses the criticism of #7776 that it relied on uncertain timings. Is there any reason to worry that someone might start terminal processes that never get attached to? This seems bind the behavior of the TerminalProcess
fairly tightly to a set of expectations that may only apply to the task system.
1dc1667
to
41bba3a
Compare
@EstherPerelman, sorry for the delay. I will take another look at this later today or tomorrow. |
b088789
to
912fa52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marechal-p, I know this something you've given some thought to. Do you have any opinions about the approach adopted here? I think it works, ensures cleanup, and is relatively non-breaking, so I'm inclined to accept it, for now, but maybe there's a better option available without a major refactor?
@@ -45,6 +46,16 @@ export class TerminalServer extends BaseTerminalServer implements ITerminalServe | |||
this.logger.error('Error while creating terminal', error); | |||
resolve(-1); | |||
}); | |||
|
|||
const taskTerm = this.taskTerminalFactory(options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we're creating both a taskTerminal
and a normal terminal in this Promise
. Is that intended, or should we create or the other, depending on some conditional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this after the builds here failed but I think it can be omitted. (removed)
11cdc55
to
1923945
Compare
@marechal-p @colin-grant-work WDYS? Can it be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll give my tentative approval, but I'm still hoping someone else will be willing to give a look.
Signed-off-by: Esther Perelman <[email protected]>
1923945
to
db77887
Compare
@marechal-p Thank you for reviewing! I updated the code accordingly. |
@EstherPerelman I am fine with the changes, thanks! Note that I am still working on refactoring processes and terminals, and I'll have a very different implementation than what you did here, although functionality will be the same. I still need more time to finish that refactoring, and I'll be unavailable the whole week that starts May 24th. This means that I'll most likely try to merge my refactoring after the next release. All of that to ask if you are ok with merging your change now, knowing it might be obsolete sometime later after the next release? If so let's merge this PR :) |
@marechal-p I'm ok with merging now, Thank you! |
Signed-off-by: Esther Perelman [email protected]
Most of PR description copied from #7776
What it does
How to test
echo hello
, and check the task terminal widget for its title and output;Demo:
Review checklist
Reminder for reviewers