Skip to content
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 nf-tower plugin to upload logs when early failures #5434

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -21,7 +21,9 @@ import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import nextflow.Session
import nextflow.SysEnv
import nextflow.processor.TaskHandler
import nextflow.trace.TraceObserver
import nextflow.trace.TraceRecord
import nextflow.util.Duration
import nextflow.util.Threads
/**
@@ -47,19 +49,20 @@ class LogsCheckpoint implements TraceObserver {
this.config = session.config
this.handler = new LogsHandler(session, SysEnv.get())
this.interval = config.navigate('tower.logs.checkpoint.interval', defaultInterval()) as Duration
thread = Threads.start('tower-logs-checkpoint', this.&run)
}

private String defaultInterval() {
SysEnv.get('TOWER_LOGS_CHECKPOINT_INTERVAL','90s')
}

@Override
void onFlowBegin() {
thread = Threads.start('tower-logs-checkpoint', this.&run)
void onFlowComplete() {
this.terminated = true
thread.join()
}

@Override
void onFlowComplete() {
void onFlowError(TaskHandler handler, TraceRecord trace){
this.terminated = true
thread.join()
}