-
Notifications
You must be signed in to change notification settings - Fork 282
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
Test also on PHP 7.2+ #3186
Test also on PHP 7.2+ #3186
Conversation
Rationale: Who knows all the upcoming changes to PHP and our obstacles? |
Mh if nightlies contain bugs, this will break travis tests on PRs. The benefit of testing the git master against nightlies is then gone. Imho this should be done in a Jenkins job, separate from code commits. |
@dnsmichi Well, if even this PR fails to be tested... then you're damn right. |
Hint: add |
ec8ed6b
to
2459f34
Compare
@@ -531,7 +531,7 @@ protected function loadConfig() | |||
*/ | |||
protected function setupErrorHandling() | |||
{ | |||
error_reporting(E_ALL | E_STRICT); | |||
error_reporting((E_ALL | E_STRICT) & ~ E_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mh you should see them imho. This allows to react sooner on possibly removed things, especially if you are really testing the new "hot shit".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just testing. Don't panic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then edit the PR's title to include "WIP: " as prefix :)
dcba443
to
4dc6b5e
Compare
But why don't we close the session just once – at shutdown? |
@Al2Klimov |
a345e2f
to
9585f47
Compare
Gentlemen, it's your turn. B-) |
Short note: the former session code looks like it tried to avoid issues with "headers already sent". No idea for what use case, but it looks like the new variant would break that countermeasure. Eventually @lippserd can have a look at this. Filter -> good catch! Static code analysis is not that bad at all 😆. |
@Thomas-Gelf What break? I've tested that stuff w/ class IndexController extends Controller
{
protected $requiresAuthentication = false;
public function indexAction()
{
$s = Session::getSession();
$s->write();
$s->write();
$s->write();
var_dump(headers_list());
}
} The former session code (efa23ad) was requested by you to "Allow sessions to be reopened" – and it still works. |
Nothing is wrong with your code alone, and I'm sure tests are fine. So, it's no break per se, but it changes current behavior. To me the old code looks like it has intentionally been placed there. It told PHP to not send headers on it's own (triggered by session_start) at that early stage. There might be a reason for this, other components might rely on deferred header sending. But you should better discuss this with @lippserd. |
@Al2Klimov: just in case you're wondering, the referenced issue 5510 refers to dev.icinga.org, it's #457 here on GitHub. |
No, I'm not. But thank you anyway. |
Just tested w/ class IndexController extends Controller
{
protected $requiresAuthentication = false;
public function indexAction()
{
$s = Session::getSession();
$s->write();
while (ob_get_level()) {
ob_end_clean();
}
echo 'foobar';
$s->write();
var_dump(headers_list());
}
} (It doesn't work.) |
... but IMO it doesn't break anything... except write operations at shutdown time. :/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Al2Klimov: there are too many unrelated (but important) changes in this pull request, we should extract the unrelated ones. Could you please start with cc9bf70 and 4f5b1ed and open dedicated pull requests for them? They are clearly bugs, I'd love to merge them immediately. With less priority the same goes true for b3ab01f.
You could also create a dedicated one enabling 7.2 on travis but allowing it to fail, so we could easily merge to master also that part. Once rebased, all branches would then already show test results for 7.2 without officially "breaking".
Why "a dedicated one" – and not this one? One nice day we just turn it on (disallow failing). |
6e4f86b
to
f334a9e
Compare
@Thomas-Gelf We don't have to allow Travis to fail – if you give green light on #3213 |
Perfect, merged all three of them, thank you. Same game again please for f334a9e and cf85e66. Also for f8a71b7, but there please extend the commit message and explain your motivation for this commit. Is our default error_reporting too low? Or too strict on PHP 7.2? What would fail (or not fail) without this change? |
cf85e66? IMO we need this only here. |
f334a9e
to
4dd90cd
Compare
The only commit that will remain in this pull request is 2d5140a - as it is the only one that fit's the topic. The others fix related issues. To me cf85e66 is clearly a bugfix. Parts of this have been triggered by 91b0e98, one line is older. I'm wondering why this didn't fail earlier, I would have expected also older PHP versions to warn on this. Next, what was the motivation for 6fc90be (PhpCodeValidityTest)? It does obviously more than And the last big beast is the session. That one requires special care. Some weird things in the original implementation derive from locking/performance reasons, as @lippserd pointed out. Not writing when nothing changed always makes sense, it saves a lot of I/O. Still, even with no change from time to time we need to force a write, as otherwise GC would kill our session. Immediately closing the session on write is even more critical, as the default PHP behavior would have devastating effect on our performance. And what remains last: modules like Nagvis are forced to do weird things with sessions. They shut one session down, start the other one, switch back - none of this works reliably when PHP headers are sent out early. This and related issues are what those INI settings should have taken care of. To keep things short: there is too much duplicated code in PhpSession72. Please have a look at the write() method, just to name one example. There is one differing line, no need to clone the whole method. Please isolate the tasks causing trouble on 7.2 in the original file into dedicate methods and then override only them. Thanks, |
4dd90cd
to
c8930f3
Compare
We're getting closer :-) |
I cherry-picked c8930f3 to speed things up. Please move the fixes for the Session to a dedicated pull request and address above change requests. Thanks for the good work! |
055dca6
to
45a508e
Compare
45a508e
to
920aa4a
Compare
@Thomas-Gelf As long as Travis fails, please wait until I've rebased the other merged PRs. |
This is only waiting for the pr to drop 5.3 then? |
@SMillerDev No, it isn't. |
920aa4a
to
a77ea2f
Compare
No description provided.