view · edit · sidebar · attach · print · history

20120718-debug-update-bsv-job

<< | Index | >>


Summary

  • Debug update_bsv Job

Commits

Index

  • Debug bsv_xml
    • Corrupted data
    • archived source file

Debug bsv_xml

Corrupted data

This error also caused by corrupted data.

Could not create: :!registration,51164!sequence,01!016!sl_entry., reason: :!registration,51164!sequence,01!016!sl_entry. -> ODDB::Sequence::package(016) returned nil
Could not create: :!registration,51164!sequence,01!024!sl_entry., reason: :!registration,51164!sequence,01!024!sl_entry. -> ODDB::Sequence::package(024) returned nil
ODBA::Stub was unable to replace ODDB::SlEntry#705477 from ODDB::Package:#226260
...

in src/plugin/bsv_xml.rb

            @sl_entries.each do |pac_ptr, sl_data|
              pack = pac_ptr.resolve @app 
              @known_packages.delete pac_ptr
              unless pack.nil?
                pointer = pac_ptr + :sl_entry
                if sl_data.empty?
                  if pack.sl_entry
                    @deleted_sl_entries += 1 
                    @app.delete pointer
                  end  
                else 
                  if pack.sl_entry
                    @updated_sl_entries += 1 
                  else 
                    @created_sl_entries += 1 
                  end  
                  if (lim_data = @lim_texts[pac_ptr]) && !lim_data.empty?
                    sl_data.store :limitation, true 
                  end  
                  @app.update pointer.creator, sl_data, :bag 
                end  
              end

I created creation package belongs to sequence.
These packages are once deleted.

             seq = pack.sequence
              unless seq.package(pack.ikscd) # once deleted package
                pack = seq.create_package(pack.ikscd)
                @app.update(seq.pointer, {:packages => seq.packages}, :bag)
              end
Could not create: :!registration,54824!sequence,03!package,033!!limitation_text., reason: :!registration,54824!sequence,03!package,033!!limitation_text. -> ODDB::Package::sl_entry() returned nil

Finaly, I could prevent error following code.

in src/plugin/bsv_xml.rb

+            seq = pack.sequence
+            unless seq.package(pack.ikscd) # once deleted package
+              pack.create_sl_entry unless pack.sl_entry
+              seq.instance_eval { @packages.store(pack.ikscd, pack) }
+              @app.update(seq.pointer, {:packages => seq.packages}, :bag)
+            end

suspend

archived source file

2012-07-01 09:01:43 CEST
FileUtils.compare_file(/tmp/foo20120701-18539-1vmfsh7,
/var/www/oddb.org/data/xml/XMLPublications-latest.zip) = false
2012-07-02 06:23:20 CEST
FileUtils.compare_file(/tmp/foo20120702-20517-mz82t7,
/var/www/oddb.org/data/xml/XMLPublications-latest.zip) = false
2012-07-14 09:09:11 CEST
FileUtils.compare_file(/tmp/foo20120714-21663-pnyu6u,
/var/www/oddb.org/data/xml/XMLPublications-latest.zip) = false
2012-07-15 09:06:57 CEST
FileUtils.compare_file(/tmp/foo20120715-15034-1nmd7zi,
/var/www/oddb.org/data/xml/XMLPublications-latest.zip) = false
2012-07-16 09:07:04 CEST
FileUtils.compare_file(/tmp/foo20120716-18119-1kvgq1t,
/var/www/oddb.org/data/xml/XMLPublications-latest.zip) = false
2012-07-18 09:02:42 CEST
FileUtils.compare_file(/tmp/foo20120718-17224-ane0vn,
/var/www/oddb.org/data/xml
in /tmp directory

temp files remains.

-rw-r--r--  1 apache apache  4268875 Jun 29 09:01 foo20120629-32572-130p3lp.1
-rw-r--r--  1 apache apache  4268875 Jun 30 09:01 foo20120630-15610-7ffwke.1
-rw-r--r--  1 apache apache  4273453 Jul  1 09:01 foo20120701-18539-1vmfsh7.1
-rw-r--r--  1 apache apache  4273453 Jul  2 06:23 foo20120702-20517-mz82t7.1
-rw-r--r--  1 apache apache  4273453 Jul 14 09:09 foo20120714-21663-pnyu6u.1
-rw-r--r--  1 apache apache  4273453 Jul 15 09:06 foo20120715-15034-1nmd7zi.1
-rw-r--r--  1 apache apache  4273453 Jul 16 09:07 foo20120716-18119-1kvgq1t.1
-rw-r--r--  1 apache apache  4273453 Jul 18 09:02 foo20120718-17224-ane0vn.1
    ensure
      if temp 
        temp.close
        temp.unlink
      end  
    end
NOTE

FileUtils.compare_file can handle symbolic link.

irb(main):007:0> FileUtils.compare_file('/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/data/xml/XMLPublications-2012.07.18.zip.8', '/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/data/xml/XMLPublications-2012.07.18.zip')
=> true
irb(main):008:0> FileUtils.compare_file('/var/www/ch.oddb.org/data/xml/XMLPublications-2012.07.18.zip.8', '/var/www/ch.oddb.org/data/xml/XMLPublications-2012.07.18.zip')
=> true

Problem is file size.

   p "-----"
   p temp_file
   p File.size(temp_file)
   p latest_file
   p File.size(latest_file)
   p FileUtils.compare_file(temp_file, latest_file)
   p "-----"

#=>
"-----"
"/tmp/foo20120718-9352-b23vdo"
0
"/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/data/xml/XMLPublications-latest.zip"
4273453
false
"-----"
  • File.size
  • Tempfile.size

FileUtils#compare_file could not compare Tempfile. Because File#size method can not get file size of Tempfile.(We must use Tempfile#size)

view · edit · sidebar · attach · print · history
Page last modified on July 18, 2012, at 12:25 PM