boulder icon indicating copy to clipboard operation
boulder copied to clipboard

Implement paused-account RA handler

Open pgporada opened this issue 1 year ago • 0 comments

The RA will handle receiving an unpause request from the SFE and forwarding that request to the SA for actual account unpausing. The RA should emit a metric to calculate the duration between WFE JWT issuance and when the account was unpaused.

Related to https://github.com/letsencrypt/boulder/issues/7406 Related to https://github.com/letsencrypt/boulder/issues/7499

pgporada avatar Jun 10 '24 17:06 pgporada

Wouldn't that means we need to hook into the creation / deletion of temp files that all servlet things use? JSP temp files? JAXB temp files? AOP temp files? etc ...

joakime avatar Mar 29 '19 14:03 joakime

We don't need that much. We only need to detect if what Jetty does is deleted, i.e. primarily the war extraction because that would be fatal. A deleted JSP would just be recompiled.

sbordet avatar Mar 29 '19 14:03 sbordet

A JSP (its actually the compiled JSP class) deleted from the temp directory can cause a classloader issue (as shown in past filed issues) The unpacked WEB-INF/lib/*.jar!META-INF/resources can also cause problems if they go missing.

Perhaps instead we "tag" the directory with something like .jetty-touch and look for that specific file occasionally, if it's gone, then we know the directory was removed out from underneath Jetty. But even that isn't a good solution, as we could accidentally have that specific file locked (like on MS Windows), but other files / directories get removed/deleted. But what do we do then?

Have to at least stop the active webapp to prevent more requests. Then hot-deploy a fresh copy? What if the user has hot-deploy disabled? stop the server with a big honking error message? Also, we can't run the destroy / de-init steps reliably, what does that mean?

joakime avatar Mar 29 '19 16:03 joakime

Perhaps instead we "tag" the directory with something like .jetty-touch and look for that specific file occasionally, if it's gone, then we know the directory was removed out from underneath Jetty.

How's that different from checking for the existence of the directory itself?

But what do we do then?

Now we do nothing, so a warning is already something better.

If hot-deploy is enabled, we can check periodically from the deployer and redeploy. If hot-deploy is disabled we can attempt a redeploy, and if that fails we try to stop the context and at least there is a warning.

sbordet avatar Mar 29 '19 16:03 sbordet

I suppose it would be possible for the deployer to periodically check all contexts it knows about for:

  • context.getWar() isn't a directory (don't want to do checks on webapps deployed directly as dirs)
  • context.isStarted() (don't want to do checks on a webapp that might be in the middle of starting, or hasn't been started yet)
  • context.getBaseResource() is a directory and the directory exists

It would be easy to print a warning if the webapp has been unpacked and the unpacked dir has disappeared and the webapp is running.

It would be much more problematic to do a redeploy: it would require synchronization so that we don't try and redeploy a context that is already being redeployed (eg due to changed .xml or .war file) or deliberately stopped/removed either manually or via jmx etc etc

Also, this only handles the situation where the deployer is used. Embedded users also can have the problem that the temp directory disappears.

janbartel avatar Apr 02 '19 06:04 janbartel

At this point in the conversation I think we are left with ...

  1. Detect filesystem changes.
  2. Warn if problem detected.
  3. Don't even attempt to reload / redeploy / hotdeploy the webapp that now has the problem.

joakime avatar Apr 08 '19 20:04 joakime

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 07 '20 21:04 stale[bot]

This is so common (war deployed to a place that is periodically wiped out) that we should do something about. Either always deploy to $JETTY_BASE/tmp, or warn if the deployer can't find the wiped out wars.

sbordet avatar Apr 13 '20 13:04 sbordet

We already have a mechanism that if $JETTY_BASE/work directory exists, then it is used for the temp directory. Note however that it has slightly different semantics as it is not cleared on a stop so things like compiled JSPs can persist.

gregw avatar Apr 14 '20 07:04 gregw

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 02 '21 17:06 stale[bot]

Perhaps instead we "tag" the directory with something like .jetty-touch and look for that specific file occasionally, if it's gone, then we know the directory was removed out from underneath Jetty.

How's that different from checking for the existence of the directory itself?

On windows, you can new File("directoryFoo").delete() and then do new File("directoryFoo").exists() and get true, as the filesystem locks and what not have not released that directory to Java yet, and this can take A LOOONG time to resolve itself on that running instance of Java.

A file, that is never opened by anything in Jetty, will avoid the File locks in windows that causes all of the problems we have there. That's why I proposed using a file to test for delete, vs testing for a directory is deleted.

joakime avatar Jun 02 '21 18:06 joakime

I think it would be far simpler to just warn if /tmp is used and perhaps default to using the $JETTY_BASE/work directory ?

gregw avatar Jun 04 '21 00:06 gregw

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jun 05 '22 00:06 github-actions[bot]

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jun 06 '23 00:06 github-actions[bot]

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jun 06 '24 00:06 github-actions[bot]

This issue has been closed due to it having no activity.

github-actions[bot] avatar Jul 06 '24 00:07 github-actions[bot]