10 Replies Latest reply: Jun 17, 2012 4:22 AM by sabre150 RSS

    Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.

    943599
      Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced while changing OS time.
      I found a BUG in java bug list. The bug id is 6311057 with fixed status. But I find it still existing.

      Under CentOS6 x64 platform, on JDK1.6.0_33, the bug still exists.
      But under CentOS5 x64 platform, on same JDK, the problem does not exist.

      Could anyone give me help? Thanks.

      The bug's link is http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311057

      Edited by: user10222290 on 2012-6-13 下午9:22
        • 1. Re: Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.
          gimbal2
          All you can do is open up a new bug report, link to the old one and hope that Oracle takes it more seriously than Sun did. That doesn't help you right now, so if this is a high priority issue for you then you'll have little choice but to revert back to CentOS5, or perhaps find a patch for CentOS6 that somehow remedies the situation.

          Note that you have to put in perspective what you're saying here; the way you present it is misleading because you flip it around.

          In CentOS5 - no problems.
          In CentOS6 (a newer release) - problems.

          Any way you slice it with the information that you have, its the new release of the OS that is causing the issue, not Java. Because as you say - its the same JDK. I have read the bug page you linked to and I agree that it is likely related, but it is hard to use a 7 year old closed bug as ammunition.

          Also note: this is not Oracle support. Oracle employees hardly ever respond here.
          • 2. Re: Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.
            943599
            Thanks for your response, I'll report this bug to oracle. I hope the solution could reach us as soon. My clients have installed CentOS6 and would not downgrade to 5. So now I have no idea except reporting this bug.

            Edited by: user10222290 on 2012-6-14 上午3:05
            • 3. Re: Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.
              gimbal2
              There is always the option of opening up a support contract with Oracle. But yeah, that has a pricetag attached to it and even then there is no guarantee that your case is picked up.
              • 4. Re: Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.
                sabre150
                The biggest problem I have with this bug is understanding why it is a problem. I frequently use wait(delta time) and Thread.sleep(delta time) on Linux and Windows but I never adjust the OS time and have difficulty envisaging a scenario in which my users might adjust the OS time.
                • 5. Re: Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.
                  943599
                  One server could want to synchronize it's OS time with another server when they connected each other for some business reasons. Some threads have started to run before changing OS time, so these thread's sleep process will be influenced sometime seriously. If OS time was turned back some days, these thread could not wake up untill some days passed.
                  • 6. Re: Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.
                    sabre150
                    user10222290 wrote:
                    One server could want to synchronize it's OS time with another server when they connected each other for some business reasons.
                    I have 3 computers running pretty much continuously with time synchronised from one of the internet time servers. They never seem to be more than about 1/10 th second apart and any time corrections are very very small.
                    Some threads have started to run before changing OS time, so these thread's sleep process will be influenced sometime seriously.
                    I understand that but I would only expect this to be a problem when there is a significant change to the OS time. If each server is synchronized to a time server then the time corrections will be very very small.
                    If OS time was turned back some days, these thread could not wake up untill some days passed.
                    Agreed but why would the "OS time be turned back some days" ?

                    This whole problem seems to me to arise because the servers are not time synchronized. Now I understand that there may be concerns about the security of external time servers but it is easy enough to make one of the local servers a master and act as a time server to the others.

                    I have a small server that typically services some 30 or so external clients. I don't have any control over the clients and do not know anything about the setting of their system clocks. The clients send a time signal as part of a heartbeat and from this the server keeps track of the local time on each client and compensates for any difference when writing logs. I have seen this difference as big as 4 months but the compensation corrects it to within about a second. No adjustment of clocks is required for this.

                    I still don't see this 'bug' as a serious bug. I just see a design problem to be solved without changing the OS time on any computer. I know this can be done since I do it. The only problem I see is if you want an accuracy of better than about 20 mS but that does not seem to be required for your system.

                    Note - if Oracle accept your new bug report it could take years to fix even if lots of people vote for it to be fixed.
                    • 7. Re: Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.
                      gimbal2
                      sabre150 wrote:
                      I still don't see this 'bug' as a serious bug. I just see a design problem to be solved without changing the OS time on any computer.
                      Yeah, I fully agree there.

                      But what I've learned over the years is that it usually doesn't make a difference anyway - the wonky "solution" is there and no matter how hard the OP may object on our behalf to his superiors, its going to stay and fester. Might as well do everything there is to be done, which in this case is report the bug. If Oracle accepts it it may indeed take years to fix (if ever), but it is something that the OP can show that might persuade people greedily hoarding budgets to allow to go another route.
                      • 8. Re: Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.
                        943599
                        I think this is two questions.
                        First, this is a bug, very basic bug, ever existed bug. Oracle should give fix as soon as quickly in my opinion, but that is not fact.
                        Second, I should be looking for another solution to avoid this problem not solve it. So that is not design problem, other solutions are not good suggestions.

                        In addition, my software is a product for many clients not a project for only client. So actual usage will be very complex and unpredictable. Maybe this bug is fatal problem in some cases. You guys should not think that this is not a serious problem.
                        • 9. Re: Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.
                          EJP
                          You need to understand several things.

                          1. This is a user-to-user forum.
                          2. There is little or no official Oracle presence on these forums.
                          3. 'You guys' are therefore just other users like yourself.
                          4. Therefore what 'you guys' think is serious or not is of little importance to you, as it doesn't reflect Oracle's official position or possible actions.
                          • 10. Re: Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.
                            sabre150
                            user10222290 wrote:
                            I think this is two questions.
                            First, this is a bug, very basic bug, ever existed bug. Oracle should give fix as soon as quickly in my opinion, but that is not fact.
                            So we disagree on how serious the bug is. Since I designed my systems so that the server clock is synchronized to a time server and the actual time on the client clock does not really matter I don't see it as a serious bug. Since you have not taken these precautions you do!
                            Second, I should be looking for another solution to avoid this problem not solve it. So that is not design problem, other solutions are not good suggestions.
                            I don't really understand this. I designed my system to avoid the problem. I would like to know why you think it is not a design problem and why the other suggestions are not good.

                            >
                            In addition, my software is a product for many clients not a project for only client. So actual usage will be very complex and unpredictable. Maybe this bug is fatal problem in some cases. You guys should not think that this is not a serious problem.
                            Presumably your clients are written in Java ( otherwise this thread would not be posted here) so since you have no control over the clients it seems you did not write the clients. Is that correct? If so then this is not your problem - it is a problem for those who did write the clients and you should raise a bug report against them.