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

stopFlag sometimes does not stop #442

Closed
CodeLieutenant opened this issue Dec 2, 2024 · 1 comment · Fixed by #440
Closed

stopFlag sometimes does not stop #442

CodeLieutenant opened this issue Dec 2, 2024 · 1 comment · Fixed by #440
Assignees
Labels
bug Something isn't working
Milestone

Comments

@CodeLieutenant
Copy link
Contributor

As observed in the following gemini runs:

As observered in this runs, these jobs run until they are killed by Jenkins or Abroted by the user. Even thou gemeni finished it's work(by error or success) it was left in a state of running. This is due to stopFlag not exiting the program for some reason. There are two wasy to tackle this issue:

  1. Fix stopFlag package
  2. Remove it in favour of context.Context

context is Go package used mainly to signal cancelation.
stopFlag inside of gemini is used the same way. It contains concept of HARD KILL which is used to signal the immadiet stoppage for gemini, without pritting the results. There is no reason to have HARD kill in the application, if we need hard kill, SIGKILL can be sent and everything will stop.
stopFlag only adds testing burden, and by the looks of it, it is just a wrapper to context.Context with signal handling. All of that can be replaces with one line:

ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGTERM, syscall.SIGABRT, syscall.SIGINT)

This issue is really hard to replicated locally. It happens randomly (after many runs, can be caught). It cannot be discovered throught the debugger (debugger works without optimizations, and the case is never caught)

@fruch
Copy link
Collaborator

fruch commented Dec 3, 2024

Yet again, what's wrong with the stopFlag ?
If it's a thin wrapper on the same thing you're gonna replace it with, how can we know the issue with it getting stuck won't happen regardless?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants