Skip to content

VDB-966 terminate container#25

Merged
elizabethengelman merged 5 commits intostagingfrom
vdb-966-terminate-container
Nov 26, 2019
Merged

VDB-966 terminate container#25
elizabethengelman merged 5 commits intostagingfrom
vdb-966-terminate-container

Conversation

@elizabethengelman
Copy link
Copy Markdown
Contributor

@elizabethengelman elizabethengelman commented Nov 25, 2019

  • terminates the container if one of the processes exits for some reason
  • we probably want to switch to having a different container for each process at some point, but i think this may be helpful in the short term
  • also added some error messaging/refactored testing if required arguments have been passed to docker run

@elizabethengelman elizabethengelman changed the title Vdb 966 terminate container WIP - Vdb 966 terminate container Nov 25, 2019
@elizabethengelman elizabethengelman force-pushed the vdb-966-terminate-container branch 2 times, most recently from 792293a to b072401 Compare November 25, 2019 19:36
@elizabethengelman elizabethengelman changed the title WIP - Vdb 966 terminate container VDB-966 terminate container Nov 25, 2019
# Check every 60 seconds to see if either process has excited.
# If grepping for process names finds something, they exit with 0 status. If they are not both 0, then one of the processes has already excited.

while sleep 60; do
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one thing to note is that when stopping the docker container with CTRL+C, it seems to finish the current sleep, and won't actually terminate for another 60 seconds. This doesn't seem ideal. I suppose we could pass in a sleep time, so that we can set it to 1 for development purposes. I'd love to hear other thoughts about this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, this is so lightweight anyway that checking every 10-15 seconds would be fine too, and eliminate that problem.

The long term solution to this is IMO to figure out how to call vDB with a set of commands and do it's own concurrency with goroutines, since the current system is bad practice anyway.. :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that this is no problem and potentially cutting down the interval could make sense.

I think enabling vdb to be invoked with a set of commands is a cool idea but I'd also be in favor of isolating each command in its own container (and breaking up execute so that we can have separate containers extracting logs vs extracting diffs vs transforming logs vs transforming diffs). Thinking that should make it easier to restart an isolated process that fails without needing to restart everything (rather than the current approach which means we have to restart header sync due to an unrelated fatal error in the event transformer execution)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, thanks for the feedback guys! i'll drop the checking interval to 10 seconds.

and yep, i definitely agree that we need to rework how we're kicking off vdb. I was also thinking along the lines of breaking things up into different containers. but i like the idea of breaking our current commands down even further as well. 👍

Copy link
Copy Markdown
Contributor

@m0ar m0ar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Shorter proc check interval would solve the container kill delay :)

# Check every 60 seconds to see if either process has excited.
# If grepping for process names finds something, they exit with 0 status. If they are not both 0, then one of the processes has already excited.

while sleep 60; do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, this is so lightweight anyway that checking every 10-15 seconds would be fine too, and eliminate that problem.

The long term solution to this is IMO to figure out how to call vDB with a set of commands and do it's own concurrency with goroutines, since the current system is bad practice anyway.. :)

@elizabethengelman elizabethengelman force-pushed the vdb-966-terminate-container branch 2 times, most recently from 92bc4c0 to 9940115 Compare November 26, 2019 20:25
@elizabethengelman elizabethengelman force-pushed the vdb-966-terminate-container branch from 9940115 to 6722917 Compare November 26, 2019 20:41
@elizabethengelman elizabethengelman merged commit f5e6d84 into staging Nov 26, 2019
@elizabethengelman elizabethengelman deleted the vdb-966-terminate-container branch November 26, 2019 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants