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

When running cron event produces a fatal error, the shutdown function doesn't run #70

Open
2 tasks done
jakubmikita opened this issue Feb 4, 2021 · 3 comments
Open
2 tasks done

Comments

@jakubmikita
Copy link

Bug Report

Describe the current, buggy behavior

While running a regular cron command:

wp cron event run --due-now

once the event produces a fatal error, the shutdown action and custom register_shutdown_function isn't called.

Describe how other contributors can replicate this bug

  1. Register an example cron event.
  2. Use callback
add_action( 'example', function() {
	undef_function_9j8yf8me();
} );
  1. Watch for log file
register_shutdown_function( function() {
	file_put_contents( dirname( __FILE__ ) . '/log.log', print_r( 'Shutdown called correctly', true ) . "\r\n\r\n", FILE_APPEND );
} );
  1. Run event - the log is not saved.
  2. Comment the call to undefined function in the event callback.
  3. Run event - the log is saved.

Describe what you would expect as the correct outcome

The shutdown function, thus shutdown action executing with fatal errors.

@justinmaurerdotdev
Copy link

I'll be looking at this today, during Contributor Day.

@justinmaurerdotdev
Copy link

Per my PR at #108, I believe this issue is not valid and can be closed as such.

@johnbillion
Copy link
Contributor

@jakubmikita Are you still experiencing this issue? Can you take a look at the tests in #108 and confirm whether they accurately represent the issue you saw?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants