Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

System crashes when logging is not enabled(Interview Question)

 
Vijaykumar Ramalingam
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,
I faced a google interview question that a system crashes when logging is not enabled and asked me the reasons for it.
I told them it is because it is a real time monitoring application system that runs on data from the logs.
But he said to me that the log statements are at the debug level and think of other reasons.
I couldnt think of a real solution for it.
Could you guys help me.
BTW:I am not sure of the question also like is (The system crashes when log is enabled/disabled?).

Thanks,
-Vijay
 
Rob Spoor
Sheriff
Pie
Posts: 20497
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Possibly the logging statements have side effects. Something like this:
Although the example is a bit daft, it does modify behaviour if debugging is disabled - i will not be increased.
 
chander shivdasani
Ranch Hand
Posts: 206
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:Possibly the logging statements have side effects. Something like this:
Although the example is a bit daft, it does modify behaviour if debugging is disabled - i will not be increased.


Exactly!
 
Mike Simmons
Ranch Hand
Posts: 3028
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A more subtle cause might be that the code has concurrency bugs, and the log statements have the effect of slowing down some parts of the system, such that the concurrency bug does not manifest. But without the logging, the timing changes, and the bug manifests.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic